public abstract class Parser extends FrontendDefaultHandler
An initial report definition handler must be set before the parser can be used.
Modifier and Type | Field and Description |
---|---|
static String |
CONTENTBASE_KEY
A key for the content base.
|
Constructor and Description |
---|
Parser()
Creates a new parser.
|
Modifier and Type | Method and Description |
---|---|
void |
characters(char[] ch,
int start,
int length)
Receive notification of character data inside an element.
|
void |
endDocument()
Receive notification of the end of the document.
|
void |
endElement(String uri,
String localName,
String qName)
Receive notification of the end of an element.
|
String[] |
getComments()
Returns the currently collected comments.
|
Object |
getHelperObject(String key)
Returns a helper object.
|
ElementDefinitionHandler |
getInitialFactory()
Returns the initial handler.
|
abstract Parser |
getInstance()
Returns a new instance of the parser.
|
abstract Object |
getResult()
Returns the parsed result object after the parsing is complete.
|
FrontendDefaultHandler |
newInstance()
Returns a new instance of
FrontendDefaultHandler . |
ElementDefinitionHandler |
peekFactory()
Reads a handler off the stack without removing it.
|
ElementDefinitionHandler |
popFactory()
Pops a handler from the stack.
|
void |
pushFactory(ElementDefinitionHandler factory)
Pushes a handler onto the stack.
|
void |
setHelperObject(String key,
Object value)
Sets a helper object.
|
void |
setInitialFactory(ElementDefinitionHandler factory)
Sets the initial handler.
|
void |
startDocument()
Receive notification of the beginning of the document.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
Receive notification of the start of an element.
|
clone, findPropertyKeys, getCommentHandler, getConfigProperties, getConfigProperty, getConfigProperty, getContentBase, getLocator, setConfigProperty, setDocumentLocator
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
public static final String CONTENTBASE_KEY
public String[] getComments()
public void pushFactory(ElementDefinitionHandler factory)
factory
- the handler.public ElementDefinitionHandler peekFactory()
public ElementDefinitionHandler popFactory()
public void endDocument() throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of a document (such as finalising a tree or closing an output file).
endDocument
in interface ContentHandler
endDocument
in class DefaultHandler
SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.endDocument()
public void startDocument() throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the beginning of a document (such as allocating the root node of a tree or creating an output file).
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.startDocument()
public void characters(char[] ch, int start, int length) throws SAXException
By default, do nothing. Application writers may override this method to take specific actions for each chunk of character data (such as adding the data to a node or buffer, or printing it to a file).
characters
in interface ContentHandler
characters
in class DefaultHandler
ch
- the characters.start
- the start position in the character array.length
- the number of characters to use from the character array.SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.characters(char[], int, int)
public void endElement(String uri, String localName, String qName) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the end of each element (such as finalising a tree node or writing output to a file).
endElement
in interface ContentHandler
endElement
in class DefaultHandler
uri
- the URI.localName
- the element type name.qName
- the name.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
By default, do nothing. Application writers may override this method in a subclass to take specific actions at the start of each element (such as allocating a new tree node or writing output to a file).
startElement
in interface ContentHandler
startElement
in class DefaultHandler
uri
- the URI.localName
- the element type name.qName
- the name.attributes
- the specified or defaulted attributes.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.startElement(java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes)
public void setInitialFactory(ElementDefinitionHandler factory)
factory
- the initial handler.public ElementDefinitionHandler getInitialFactory()
public void setHelperObject(String key, Object value)
key
- the key.value
- the value.public Object getHelperObject(String key)
key
- the key.public abstract Parser getInstance()
public final FrontendDefaultHandler newInstance()
FrontendDefaultHandler
.newInstance
in class FrontendDefaultHandler
public abstract Object getResult()
getResult
in class FrontendDefaultHandler
Copyright © 2001–2018 JFree.org. All rights reserved.