|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.faceless.report.ReportHandler
public class ReportHandler
A ContentHandler
which will parse the Report Generator XML and creeate
a PDF as a result. Normally this is created by the ReportParser
, but
for use as the final stage in an XSL transformation it's possibile to instantiate
and use this class directly. An example of how to use this would be:
ReportHandler handler = new ReportHandler(); SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(inputsource, handler); PDF pdf = handler.getPDF();
Constructor Summary | |
---|---|
ReportHandler()
|
Method Summary | |
---|---|
void |
characters(char[] c,
int start,
int len)
|
void |
endDocument()
|
void |
endElement(String nspace,
String name,
String qname)
|
void |
endPrefixMapping(String prefix)
|
boolean |
getFlag(int key)
Get the status of a flag, as set by setFlag(int, boolean) |
PDF |
getPDF()
Get the PDF that has been generated by the last XML input parsed by this ReportHandler |
void |
ignorableWhitespace(char[] c,
int start,
int len)
|
void |
processingInstruction(String target,
String data)
|
InputSource |
resolveEntity(String publicid,
String systemid)
|
void |
setDocumentLocator(Locator loc)
|
void |
setErrorHandler(ErrorHandler handler)
Set the ErrorHandler to handle any errors or warning thrown
by the parsing process. |
void |
setFlag(int key,
boolean value)
Set or clear a flag to change the parsing process. |
void |
setMetaHandler(MetaHandler handler)
Set the MetaHandler to handle any unknown Meta Tags
encountered during the parse. |
void |
startDocument()
|
void |
startElement(String nspace,
String name,
String qname,
Attributes atts)
|
void |
startPrefixMapping(String prefix,
String uri)
|
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
error, fatalError, notationDecl, skippedEntity, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ReportHandler()
Method Detail |
---|
public void setErrorHandler(ErrorHandler handler)
ErrorHandler
to handle any errors or warning thrown
by the parsing process. The default handler prints
any exceptions and warnings to System.err
and throws
a SAXException, ending the parsing process.
errorhandler
- the ErrorHandler
to use to catch
errors
SAXException
public void setMetaHandler(MetaHandler handler)
MetaHandler
to handle any unknown Meta Tags
encountered during the parse. The default handler ignores
these tags.
metahandler
- the MetaHandler
to use to process
any unrecognised meta tagspublic PDF getPDF()
public void setFlag(int key, boolean value)
#WARNING_UNKNOWN_TAG
, #WARNING_UNKNOWN_ATTRIBUTE
,
#WARNING_MISPLACED_TEXT
and #DEBUG_TO_STDOUT
flag
- the name of the flag to setvalue
- the value to set the flag topublic boolean getFlag(int key)
setFlag(int, boolean)
flag
- the name of the flag
public void setDocumentLocator(Locator loc)
setDocumentLocator
in interface ContentHandler
setDocumentLocator
in class DefaultHandler
public void startDocument()
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
public void endDocument() throws SAXException
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
public void startElement(String nspace, String name, String qname, Attributes atts) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
SAXException
public void startPrefixMapping(String prefix, String uri)
startPrefixMapping
in interface ContentHandler
startPrefixMapping
in class DefaultHandler
public void endPrefixMapping(String prefix)
endPrefixMapping
in interface ContentHandler
endPrefixMapping
in class DefaultHandler
public void endElement(String nspace, String name, String qname) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
SAXException
public void processingInstruction(String target, String data) throws SAXException
processingInstruction
in interface ContentHandler
processingInstruction
in class DefaultHandler
SAXException
public void characters(char[] c, int start, int len) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
SAXException
public void ignorableWhitespace(char[] c, int start, int len) throws SAXException
ignorableWhitespace
in interface ContentHandler
ignorableWhitespace
in class DefaultHandler
SAXException
public InputSource resolveEntity(String publicid, String systemid) throws SAXException
resolveEntity
in interface EntityResolver
resolveEntity
in class DefaultHandler
SAXException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |