com.jrefinery.report.io.simple
Class ReportFactory

java.lang.Object
  extended bycom.jrefinery.report.io.simple.AbstractReportDefinitionHandler
      extended bycom.jrefinery.report.io.simple.ReportFactory
All Implemented Interfaces:
org.jfree.xml.ElementDefinitionHandler, ReportDefinitionTags

public class ReportFactory
extends AbstractReportDefinitionHandler
implements ReportDefinitionTags

A handler for the SAX events generated by the top level element in the JFreeReport XML report definition file.

Author:
Thomas Morgner

Field Summary
 
Fields inherited from interface com.jrefinery.report.io.simple.ReportDefinitionTags
ALIGNMENT_ATT, BOTTOMMARGIN_ATT, COLOR_ATT, CONFIGURATION_TAG, DATAREF_TAG, DATE_FIELD_TAG, DATE_FUNCTION_TAG, DEPENCY_LEVEL_ATT, DRAWABLE_FIELD_TAG, EXPRESSION_TAG, FIELD_TAG, FIELDNAME_ATT, FIELDS_TAG, FONT_NAME_ATT, FONT_SIZE_ATT, FONT_STYLE_ATT, FORMAT_ATT, FS_BOLD, FS_EMBEDDED, FS_ENCODING, FS_ITALIC, FS_STRIKETHR, FS_UNDERLINE, FUNCTION_TAG, FUNCTIONNAME_ATT, FUNCTIONS_TAG, GENERAL_FIELD_TAG, GENERAL_FUNCTION_TAG, GROUP_FOOTER_TAG, GROUP_HEADER_TAG, GROUP_TAG, GROUPS_TAG, HEIGHT_ATT, IMAGEFIELD_TAG, IMAGEFUNCTION_TAG, IMAGEREF_TAG, IMAGEURLFIELD_TAG, IMAGEURLFUNCTION_TAG, ITEMS_TAG, LABEL_TAG, LEFTMARGIN_ATT, LINE_TAG, LINEHEIGHT, MULTILINE_FIELD_TAG, MULTILINE_FUNCTION_TAG, NAME_ATT, NULLSTRING_ATT, NUMBER_FIELD_TAG, NUMBER_FUNCTION_TAG, ORIENTATION_ATT, ORIENTATION_LANDSCAPE_VAL, ORIENTATION_PORTRAIT_VAL, ORIENTATION_REVERSE_LANDSCAPE_VAL, PAGE_FOOTER_TAG, PAGE_HEADER_TAG, PAGEFORMAT_ATT, PROPERTIES_TAG, PROPERTY_ENCODING_ATT, PROPERTY_ENCODING_TEXT, PROPERTY_REFERENCE_TAG, PROPERTY_TAG, RECTANGLE_TAG, REPEAT_HEADER, REPORT_FOOTER_TAG, REPORT_HEADER_TAG, REPORT_TAG, RESOURCEBASE_ATTR, RESOURCEFIELD_TAG, RESOURCELABEL_TAG, RIGHTMARGIN_ATT, SHAPE_FIELD_TAG, STRING_FIELD_TAG, STRING_FUNCTION_TAG, TOPMARGIN_ATT, VALIGNMENT_ATT, WIDTH_ATT
 
Constructor Summary
ReportFactory(org.jfree.xml.Parser parser, java.lang.String finishTag)
          Constructs a new handler.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Receives some (or all) of the text in the current element.
 void endElement(java.lang.String qName)
          A SAX event indicating that an element end tag has been read.
protected  void endProperty()
          Ends the definition of a single property entry.
 void endReport()
          Finishes the report generation.
 void startElement(java.lang.String tagName, org.xml.sax.Attributes atts)
          A SAX event indicating that an element start tag has been read.
 void startFunctions(org.xml.sax.Attributes atts)
          Creates a new function collection for the report.
 void startGroups(org.xml.sax.Attributes atts)
          Creates a new group list for the report.
protected  void startProperty(org.xml.sax.Attributes atts)
          Starts a new property entry within the report configuration section.
 void startReport(org.xml.sax.Attributes atts)
          Creates a new report depending on the attributes given.
 
Methods inherited from class com.jrefinery.report.io.simple.AbstractReportDefinitionHandler
getContentBase, getFinishTag, getLocator, getNameGenerator, getParser, getReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReportFactory

public ReportFactory(org.jfree.xml.Parser parser,
                     java.lang.String finishTag)
Constructs a new handler.

Parameters:
parser - the used parser to coordinate the parsing process.
finishTag - the finish tag, that should trigger the deactivation of this parser.
Throws:
java.lang.NullPointerException - if the finishTag or the parser are null.
Method Detail

startElement

public void startElement(java.lang.String tagName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
A SAX event indicating that an element start tag has been read.

Specified by:
startElement in interface org.jfree.xml.ElementDefinitionHandler
Parameters:
tagName - the element name.
atts - the element attributes.
Throws:
org.xml.sax.SAXException - if there is a parsing exception.

startProperty

protected void startProperty(org.xml.sax.Attributes atts)
                      throws org.xml.sax.SAXException
Starts a new property entry within the report configuration section.

Parameters:
atts - the element attributes.
Throws:
org.xml.sax.SAXException - if there is an error parsing the XML.

characters

public void characters(char[] ch,
                       int start,
                       int length)
Receives some (or all) of the text in the current element.

Specified by:
characters in interface org.jfree.xml.ElementDefinitionHandler
Overrides:
characters in class AbstractReportDefinitionHandler
Parameters:
ch - the character array.
start - the first character index.
length - the length (number of valid characters).

endElement

public void endElement(java.lang.String qName)
                throws org.xml.sax.SAXException
A SAX event indicating that an element end tag has been read.

Specified by:
endElement in interface org.jfree.xml.ElementDefinitionHandler
Parameters:
qName - the element name.
Throws:
org.xml.sax.SAXException - if there is a parsing problem.

endProperty

protected void endProperty()
                    throws org.xml.sax.SAXException
Ends the definition of a single property entry.

Throws:
org.xml.sax.SAXException - if there is a problem parsing the element.

startReport

public void startReport(org.xml.sax.Attributes atts)
                 throws org.xml.sax.SAXException
Creates a new report depending on the attributes given.

Parameters:
atts - the element attributes.
Throws:
org.xml.sax.SAXException - if there is any problem parsing the XML.

startGroups

public void startGroups(org.xml.sax.Attributes atts)
                 throws org.xml.sax.SAXException
Creates a new group list for the report. The group factory will be the new default handler for SAX Events.

Parameters:
atts - the element attributes.
Throws:
org.xml.sax.SAXException - if there is a parsing problem.

startFunctions

public void startFunctions(org.xml.sax.Attributes atts)
                    throws org.xml.sax.SAXException
Creates a new function collection for the report. The FunctionFactory will be the new default handler for SAX Events

Parameters:
atts - the element attributes.
Throws:
org.xml.sax.SAXException - if there is a parsing problem.

endReport

public void endReport()
               throws org.xml.sax.SAXException
Finishes the report generation.

Throws:
org.xml.sax.SAXException - if there is a parsing problem.