org.jfree.xml
Class ParserFrontend
java.lang.Object
org.jfree.xml.ParserFrontend
The reportgenerator initializes the parser and provides an interface
the the default parser.
To create a report from an URL, use
ReportGenerator.getInstance().parseReport (URL myURl, URL contentBase);
ParserFrontend
protected ParserFrontend(FrontendDefaultHandler parser)
Creates a new report generator. The generator uses the singleton pattern by default,
so use generator.getInstance() to get the generator.
parser
- the parser that is used to coordinate the parsing process.
configureReader
protected void configureReader(XMLReader reader,
FrontendDefaultHandler handler)
Configures the xml reader. Use this to set features or properties
before the documents get parsed.
reader
- the xml reader that should be configured.handler
- the parser implementation that will handle the SAX-Callbacks.
createDefaultHandler
protected FrontendDefaultHandler createDefaultHandler(URL contentBase)
Creates a new instance of the currently set default handler and sets the contentbase
for the handler to contentBase
.
contentBase
- the content base.
getEntityResolver
public EntityResolver getEntityResolver()
Returns the entity resolver.
getParser
protected SAXParser getParser()
throws ParserConfigurationException,
SAXException
Returns a SAX parser.
isValidateDTD
public boolean isValidateDTD()
Returns true
if the report definition should be validated against the
DTD, and false
otherwise.
parse
protected Object parse(InputSource input,
URL contentBase)
throws ElementDefinitionException
Parses an XML report template file.
input
- the input source.contentBase
- the content base.
parse
public Object parse(URL file,
URL contentBase)
throws ElementDefinitionException,
IOException
Parses an XML file which is loaded using the given URL. All
needed relative file- and resourcespecification are loaded
using the URL
contentBase
as base.
After the report is generated, the ReportDefinition-source and the contentbase are
stored as string in the reportproperties.
file
- the URL for the report template file.contentBase
- the URL for the report template content base.
setEntityResolver
public void setEntityResolver(EntityResolver entityResolver)
Sets the entity resolver.
entityResolver
- the entity resolver.
setValidateDTD
public void setValidateDTD(boolean validateDTD)
Sets a flag that controls whether or not the report definition is validated
against the DTD.