de.smartics.exceptions.report.generator
Class AbstractReportGenerator<O>

Package class diagram package AbstractReportGenerator
java.lang.Object
  extended by de.smartics.exceptions.report.generator.AbstractReportGenerator<O>
Type Parameters:
O - the type of expected output instance.
All Implemented Interfaces:
ReportGenerator<O>
Direct Known Subclasses:
AbstractOutputReportGenerator

public abstract class AbstractReportGenerator<O>
     
     
extends Object
implements ReportGenerator<O>

Base implementation of all report generators.


Field Summary
protected  String encoding
          The encoding of the writer.
protected  O output
          The output element to pass to each method.
protected  JavadocRenderer renderer
          The renderer used to map Javadoc comments to the report's output format.
 
Fields inherited from interface de.smartics.exceptions.report.generator.ReportGenerator
DEFAULT_ENCODING
 
Constructor Summary
protected AbstractReportGenerator(JavadocRenderer renderer)
          Default constructor.
 
Method Summary
 String getEncoding()
          Returns the encoding of the writer.
 O getOutput()
          Returns the output element to pass to each method.
 void setEncoding(String encoding)
          Sets the encoding of the writer.
 void setOutput(O output)
          Sets the output element to pass to each method.
protected abstract  void writeContent(O output, ProjectConfiguration<O> config, StoredExceptionCodesReport report)
          Writes the content of the XML document.
 void writeReport(ProjectConfiguration<O> config, StoredExceptionCodesReport report)
          Writes the report with the given information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

output

protected O output
The output element to pass to each method.


encoding

protected String encoding
The encoding of the writer.


renderer

protected final JavadocRenderer renderer
The renderer used to map Javadoc comments to the report's output format.

Constructor Detail

AbstractReportGenerator

protected AbstractReportGenerator(JavadocRenderer renderer)
Default constructor.

Parameters:
renderer - the renderer used to map Javadoc comments to the report's output format.
Method Detail

getOutput

public O getOutput()
Returns the output element to pass to each method.

Specified by:
getOutput in interface ReportGenerator<O>
Returns:
the output element to pass to each method.

setOutput

public void setOutput(O output)
Sets the output element to pass to each method.

Specified by:
setOutput in interface ReportGenerator<O>
Parameters:
output - the output element to pass to each method.

getEncoding

public String getEncoding()
Returns the encoding of the writer.

Specified by:
getEncoding in interface ReportGenerator<O>
Returns:
the encoding of the writer.

setEncoding

public void setEncoding(String encoding)
Sets the encoding of the writer.

Specified by:
setEncoding in interface ReportGenerator<O>
Parameters:
encoding - the encoding of the writer.

writeReport

public void writeReport(ProjectConfiguration<O> config,
                        StoredExceptionCodesReport report)
                 throws ReportException
Writes the report with the given information.

Specified by:
writeReport in interface ReportGenerator<O>
Parameters:
config - the project configuration to control the report generation.
report - the information to write.
Throws:
ReportException - on any problem generating the report.

writeContent

protected abstract void writeContent(O output,
                                     ProjectConfiguration<O> config,
                                     StoredExceptionCodesReport report)
                              throws Exception
Writes the content of the XML document. The XML declaration is already written.

Parameters:
output - the writer to use.
config - the project configuration to control the output.
report - the information to write.
Throws:
Exception - on any problem encountered.


Copyright © 2007-2013 Kronseder & Reiner GmbH - smartics. All Rights Reserved.