|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.xml.ParserFrontend
public class 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);
Constructor Summary | |
---|---|
protected |
ParserFrontend(FrontendDefaultHandler parser)
Creates a new report generator. |
Method Summary | |
---|---|
protected void |
configureReader(org.xml.sax.XMLReader reader,
FrontendDefaultHandler handler)
Configures the xml reader. |
protected FrontendDefaultHandler |
createDefaultHandler(java.net.URL contentBase)
Creates a new instance of the currently set default handler and sets the contentbase for the handler to contentBase . |
FrontendDefaultHandler |
getDefaultHandler()
Returns the ElementDefinitionHandler used for parsing reports. |
org.xml.sax.EntityResolver |
getEntityResolver()
Returns the entity resolver. |
protected javax.xml.parsers.SAXParser |
getParser()
Returns a SAX parser. |
boolean |
isValidateDTD()
Returns true if the report definition should be validated against the
DTD, and false otherwise. |
protected java.lang.Object |
parse(org.xml.sax.InputSource input,
java.net.URL contentBase)
Parses an XML report template file. |
java.lang.Object |
parse(java.net.URL file,
java.net.URL contentBase)
Parses an XML file which is loaded using the given URL. |
void |
setDefaultHandler(FrontendDefaultHandler handler)
Sets the default handler used for parsing reports. |
void |
setEntityResolver(org.xml.sax.EntityResolver entityResolver)
Sets the entity resolver. |
void |
setValidateDTD(boolean validateDTD)
Sets a flag that controls whether or not the report definition is validated against the DTD. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected ParserFrontend(FrontendDefaultHandler parser)
parser
- the parser that is used to coordinate the parsing process.Method Detail |
---|
public boolean isValidateDTD()
true
if the report definition should be validated against the
DTD, and false
otherwise.
public void setValidateDTD(boolean validateDTD)
validateDTD
- the flag.public org.xml.sax.EntityResolver getEntityResolver()
public void setEntityResolver(org.xml.sax.EntityResolver entityResolver)
entityResolver
- the entity resolver.protected javax.xml.parsers.SAXParser getParser() throws javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
- if there is a problem configuring the parser.
org.xml.sax.SAXException
- if there is a problem with the parser initialisationpublic void setDefaultHandler(FrontendDefaultHandler handler)
handler
- the handler.public FrontendDefaultHandler getDefaultHandler()
protected FrontendDefaultHandler createDefaultHandler(java.net.URL contentBase)
contentBase
.
contentBase
- the content base.
protected java.lang.Object parse(org.xml.sax.InputSource input, java.net.URL contentBase) throws ElementDefinitionException
input
- the input source.contentBase
- the content base.
ElementDefinitionException
- if an error occurred.protected void configureReader(org.xml.sax.XMLReader reader, FrontendDefaultHandler handler)
handler
- the parser implementation that will handle the SAX-Callbacks.reader
- the xml reader that should be configured.public java.lang.Object parse(java.net.URL file, java.net.URL contentBase) throws ElementDefinitionException, java.io.IOException
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.
java.io.IOException
- if an I/O error occurs.
ElementDefinitionException
- if there is a problem parsing the report template.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |