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

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

public abstract class AbstractOutputReportGenerator<O>
     
     
extends AbstractReportGenerator<O>

Abstract implementation that helps to traverse the information.


Field Summary
 
Fields inherited from class de.smartics.exceptions.report.generator.AbstractReportGenerator
encoding, output, renderer
 
Fields inherited from interface de.smartics.exceptions.report.generator.ReportGenerator
DEFAULT_ENCODING
 
Constructor Summary
protected AbstractOutputReportGenerator(JavadocRenderer renderer)
          Default constructor.
 
Method Summary
protected abstract  String getCodeTitle(String headLine, ExceptionCodeReportItem item)
          Returns the title to be set for the report item.
protected abstract  String getCurrentSelection(ExceptionCodeReportItem item)
          Returns the selection criteria for creating subsections in the report.
protected abstract  List<ExceptionCodeReportItem> getItems(StoredExceptionCodesReport report)
          Returns the list of exception code items sorted as defined by the report.
protected abstract  boolean hasSectionChanged(String currentSection, ExceptionCodeReportItem item)
          Determines if the section has changed for the new item.
protected  void write(O output, ProjectConfiguration<O> config, StoredExceptionCodesReport report)
          Writes the content of the report data to the stream.
protected  void writeFooter(O output, ProjectConfiguration<O> config)
          Writes the footer to the document.
protected  void writeHeader(O output, ProjectConfiguration<O> config)
          Writes visible the document header.
protected abstract  void writeInfoFooter(O output, ProjectConfiguration<O> config)
          Writes the footer for the report element set to the document.
protected abstract  void writeInfoHeader(O output, ProjectConfiguration<O> config, String headLine, ExceptionCodeReportItem item)
          Writes the header for the report.
protected  void writeInfoSubHeader(O output, ProjectConfiguration<O> config, String subHeader)
          Writes the sub header information.
protected abstract  void writeReportElementInfo(O output, ProjectConfiguration<O> config, ExceptionCodeReportItem item)
          Writes the given report element information.
protected abstract  void writeTableHeader(O output, ProjectConfiguration<O> config)
          Writes the table header for the report elements set.
 
Methods inherited from class de.smartics.exceptions.report.generator.AbstractReportGenerator
getEncoding, getOutput, setEncoding, setOutput, writeContent, writeReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractOutputReportGenerator

protected AbstractOutputReportGenerator(JavadocRenderer renderer)
Default constructor.

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

write

protected void write(O output,
                     ProjectConfiguration<O> config,
                     StoredExceptionCodesReport report)
              throws Exception
Writes the content of the report data to the stream.

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

getItems

protected abstract List<ExceptionCodeReportItem> getItems(StoredExceptionCodesReport report)
Returns the list of exception code items sorted as defined by the report.

Parameters:
report - the report to access further information.
Returns:
the list of sorted items.

getCurrentSelection

protected abstract String getCurrentSelection(ExceptionCodeReportItem item)
Returns the selection criteria for creating subsections in the report.

Parameters:
item - the item to determine the criteria.
Returns:
the criteria in its text form.

hasSectionChanged

protected abstract boolean hasSectionChanged(String currentSection,
                                             ExceptionCodeReportItem item)
Determines if the section has changed for the new item.

Parameters:
currentSection - the identifier of the current section.
item - the next item to be rendered.
Returns:
if the next item is part of the current section, false is returned. If it is part of a new section, true is returned.

getCodeTitle

protected abstract String getCodeTitle(String headLine,
                                       ExceptionCodeReportItem item)
Returns the title to be set for the report item.

Parameters:
headLine - a proposed headline by the caller. May be overridden.
item - the item to construct a headline for.
Returns:
the title for the new section.

writeHeader

protected void writeHeader(O output,
                           ProjectConfiguration<O> config)
                    throws Exception
Writes visible the document header. This is the header within the body.

The default implementation is a no-op.

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

writeInfoHeader

protected abstract void writeInfoHeader(O output,
                                        ProjectConfiguration<O> config,
                                        String headLine,
                                        ExceptionCodeReportItem item)
                                 throws Exception
Writes the header for the report.

One of clazz or header may be null. If both are not null the implementation decides how to print.

Parameters:
output - the writer to write to.
config - the project configuration to control the output.
headLine - an head line text to print.
item - the information of the class whose elements are about to print.
Throws:
Exception - on any problem encountered.

writeInfoSubHeader

protected void writeInfoSubHeader(O output,
                                  ProjectConfiguration<O> config,
                                  String subHeader)
                           throws Exception
Writes the sub header information.

The default implementation is a no-op.

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

writeTableHeader

protected abstract void writeTableHeader(O output,
                                         ProjectConfiguration<O> config)
                                  throws Exception
Writes the table header for the report elements set.

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

writeReportElementInfo

protected abstract void writeReportElementInfo(O output,
                                               ProjectConfiguration<O> config,
                                               ExceptionCodeReportItem item)
                                        throws Exception
Writes the given report element information.

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

writeInfoFooter

protected abstract void writeInfoFooter(O output,
                                        ProjectConfiguration<O> config)
                                 throws Exception
Writes the footer for the report element set to the document.

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

writeFooter

protected void writeFooter(O output,
                           ProjectConfiguration<O> config)
                    throws Exception
Writes the footer to the document.

The default implementation is a no-op.

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


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