com.jrefinery.report.io.simple
Class AbstractReportDefinitionHandler

java.lang.Object
  |
  +--com.jrefinery.report.io.simple.AbstractReportDefinitionHandler
All Implemented Interfaces:
org.jfree.xml.ElementDefinitionHandler
Direct Known Subclasses:
BandFactory, ElementFactory, FunctionFactory, GroupFactory, ReportFactory

public abstract class AbstractReportDefinitionHandler
extends java.lang.Object
implements org.jfree.xml.ElementDefinitionHandler

Extends the SAX-DefaultHandler with ContentBase capabilities.

Author:
Thomas Morgner

Constructor Summary
AbstractReportDefinitionHandler(org.jfree.xml.Parser parser, java.lang.String finishTag)
          Default constructor.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Processes characters (in this case, does nothing).
 java.net.URL getContentBase()
          Gets the ContentBase used to resolve relative URLs.
 java.lang.String getFinishTag()
          Gets the selected finishTag for this ElementDefinitionHandler.
protected  org.xml.sax.Locator getLocator()
          Returns the document locator of the parser or null, if there is no locator defined.
 NameGenerator getNameGenerator()
          Returns the name generator instance for naming anonymous elements.
 org.jfree.xml.Parser getParser()
          Returns the parser.
 JFreeReport getReport()
          Returns the report after the parsing is complete.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jfree.xml.ElementDefinitionHandler
endElement, startElement
 

Constructor Detail

AbstractReportDefinitionHandler

public AbstractReportDefinitionHandler(org.jfree.xml.Parser parser,
                                       java.lang.String finishTag)
Default constructor.

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

getFinishTag

public java.lang.String getFinishTag()
Gets the selected finishTag for this ElementDefinitionHandler. The finish tag is used to recognize the right moment for deactivating this handler.

Returns:
the defined finish tag.

getReport

public JFreeReport getReport()
Returns the report after the parsing is complete.

Don't call until the report is completely built or you may get unexpected results.

Returns:
The parsed report.

getContentBase

public java.net.URL getContentBase()
Gets the ContentBase used to resolve relative URLs.

Returns:
the current contentbase, or null if no contentBase is set.

getNameGenerator

public NameGenerator getNameGenerator()
Returns the name generator instance for naming anonymous elements.

Returns:
the name generator instance used to name anonymous element during the parsing process.

getParser

public org.jfree.xml.Parser getParser()
Returns the parser.

Specified by:
getParser in interface org.jfree.xml.ElementDefinitionHandler
Returns:
The parser.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Processes characters (in this case, does nothing).

Specified by:
characters in interface org.jfree.xml.ElementDefinitionHandler
Parameters:
ch - the character array.
start - the index of the first valid character.
length - the number of valid characters.
Throws:
org.xml.sax.SAXException - if there is a parsing problem.

getLocator

protected org.xml.sax.Locator getLocator()
Returns the document locator of the parser or null, if there is no locator defined.

Returns:
the document locator or null.