Jacson

de.spieleck.app.jacson.report
Class PrintingReport

java.lang.Object
  extended byde.spieleck.app.jacson.report.PrintingReport
All Implemented Interfaces:
ConfigVerify.Acceptor, JacsonPrintReport, JacsonReport, JacsonStately
Direct Known Subclasses:
CSVReport, TestReport, ValuePrintingReport, XMLReport

public class PrintingReport
extends java.lang.Object
implements JacsonPrintReport, ConfigVerify.Acceptor

Report that prints out everything in the property file format. Also (ab)used as the baseclass of all reports that write to a file.

Author:
fsn, Patrick Carl

Field Summary
protected  java.util.LinkedList begins
           
static java.lang.String FILENAME_NODE
           
protected  java.io.PrintWriter pw
           
 
Constructor Summary
PrintingReport()
           
 
Method Summary
 boolean accept(ConfigNode cn)
           
 void begin(java.lang.String id)
          Begin a subsection within report
 void end()
          Close a subsection within a report
 void finish()
          Finish and close underlying resources
 void finish(boolean close)
          Finish and optionally close the underlying resources
protected  java.io.PrintWriter getPrintWriter()
           
 JacsonState getRegState()
          returns the set JacsonState
 void init(ConfigNode config)
          Initialize the report.
 void registerState(JacsonState state)
          Give the class access to an appropriate state.
 void report(java.lang.String localName, java.lang.String value)
          Report a single name value pair within a report
 void setOutputStream(java.io.OutputStream os)
          Or consume an OutputStream directly
 void setPrintWriter(java.io.PrintWriter pw)
          Either consume the PrintWriter directly
protected  void useFilename(ConfigNode config)
           
protected static void useFilename(JacsonPrintReport rep, ConfigNode conf, java.io.OutputStream defaultOut)
          use a Filename but be able to give a default output stream
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FILENAME_NODE

public static final java.lang.String FILENAME_NODE
See Also:
Constant Field Values

pw

protected java.io.PrintWriter pw

begins

protected java.util.LinkedList begins
Constructor Detail

PrintingReport

public PrintingReport()
Method Detail

init

public void init(ConfigNode config)
          throws JacsonConfigException
Description copied from interface: JacsonReport
Initialize the report. The passed ConfigNode can be used to obtain configuration information of the report from the global config xml.

Specified by:
init in interface JacsonReport
Throws:
JacsonConfigException

useFilename

protected void useFilename(ConfigNode config)
                    throws JacsonConfigException
Throws:
JacsonConfigException

useFilename

protected static void useFilename(JacsonPrintReport rep,
                                  ConfigNode conf,
                                  java.io.OutputStream defaultOut)
                           throws JacsonConfigException
use a Filename but be able to give a default output stream

Throws:
JacsonConfigException

accept

public boolean accept(ConfigNode cn)
Specified by:
accept in interface ConfigVerify.Acceptor

setOutputStream

public void setOutputStream(java.io.OutputStream os)
Description copied from interface: JacsonPrintReport
Or consume an OutputStream directly

Specified by:
setOutputStream in interface JacsonPrintReport

setPrintWriter

public void setPrintWriter(java.io.PrintWriter pw)
Description copied from interface: JacsonPrintReport
Either consume the PrintWriter directly

Specified by:
setPrintWriter in interface JacsonPrintReport

getPrintWriter

protected java.io.PrintWriter getPrintWriter()

begin

public void begin(java.lang.String id)
Description copied from interface: JacsonReport
Begin a subsection within report

Specified by:
begin in interface JacsonReport

report

public void report(java.lang.String localName,
                   java.lang.String value)
Description copied from interface: JacsonReport
Report a single name value pair within a report

Specified by:
report in interface JacsonReport

end

public void end()
Description copied from interface: JacsonReport
Close a subsection within a report

Specified by:
end in interface JacsonReport

finish

public void finish()
Description copied from interface: JacsonReport
Finish and close underlying resources

Specified by:
finish in interface JacsonReport

finish

public void finish(boolean close)
Description copied from interface: JacsonReport
Finish and optionally close the underlying resources

Specified by:
finish in interface JacsonReport
Parameters:
close - flag whether to close resources or not.

registerState

public void registerState(JacsonState state)
Description copied from interface: JacsonStately
Give the class access to an appropriate state.

Specified by:
registerState in interface JacsonStately

getRegState

public JacsonState getRegState()
Description copied from interface: JacsonReport
returns the set JacsonState

Specified by:
getRegState in interface JacsonReport

Spieleck

Copyleft 2002 spieleck.de.