|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.xml.sax.helpers.DefaultHandler
org.jfree.xml.Parser
public abstract class Parser
The Parser handles the SAXEvents and forwards the event call to the currently active ElementDefinitionHandler. Contains methods to manage and configure the parsing process.
An initial report definition handler must be set before the parser can be used.
Field Summary | |
---|---|
static java.lang.String |
CONTENTBASE_KEY
A key for the content base. |
Constructor Summary | |
---|---|
Parser()
Creates a new parser. |
Method Summary | |
---|---|
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(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
Receive notification of the end of an element. |
java.util.Iterator |
findPropertyKeys(java.lang.String prefix)
Returns all keys with the given prefix. |
CommentHandler |
getCommentHandler()
Returns the comment handler that is used to collect comments. |
java.lang.String[] |
getComments()
Returns the currently collected comments. |
java.lang.String |
getConfigProperty(java.lang.String key)
Returns the configuration property with the specified key. |
java.lang.String |
getConfigProperty(java.lang.String key,
java.lang.String defaultValue)
Returns the configuration property with the specified key (or the specified default value if there is no such property). |
java.lang.Object |
getHelperObject(java.lang.String key)
Returns a helper object. |
ElementDefinitionHandler |
getInitialFactory()
Returns the initial handler. |
abstract Parser |
getInstance()
Returns a new instance of the parser. |
org.xml.sax.Locator |
getLocator()
Returns the current locator. |
abstract java.lang.Object |
getResult()
Returns the parsed result object after the parsing is complete. |
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 |
setConfigProperty(java.lang.String key,
java.lang.String value)
Sets a parser configuration value. |
void |
setDocumentLocator(org.xml.sax.Locator locator)
Receive an object for locating the origin of SAX document events. |
void |
setHelperObject(java.lang.String key,
java.lang.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(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes attributes)
Receive notification of the start of an element. |
Methods inherited from class org.xml.sax.helpers.DefaultHandler |
---|
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CONTENTBASE_KEY
Constructor Detail |
---|
public Parser()
Method Detail |
---|
public CommentHandler getCommentHandler()
public java.lang.String[] getComments()
public void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator
in interface org.xml.sax.ContentHandler
setDocumentLocator
in class org.xml.sax.helpers.DefaultHandler
locator
- the locator.public org.xml.sax.Locator getLocator()
public void pushFactory(ElementDefinitionHandler factory)
factory
- the handler.public ElementDefinitionHandler peekFactory()
public ElementDefinitionHandler popFactory()
public void endDocument() throws org.xml.sax.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 org.xml.sax.ContentHandler
endDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.endDocument()
public void startDocument() throws org.xml.sax.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 org.xml.sax.ContentHandler
startDocument
in class org.xml.sax.helpers.DefaultHandler
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.startDocument()
public void characters(char[] ch, int start, int length) throws org.xml.sax.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 org.xml.sax.ContentHandler
characters
in class org.xml.sax.helpers.DefaultHandler
ch
- the characters.start
- the start position in the character array.length
- the number of characters to use from the character array.
org.xml.sax.SAXException
- Any SAX exception, possibly wrapping another exception.ContentHandler.characters(char[], int, int)
public void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName) throws org.xml.sax.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 org.xml.sax.ContentHandler
endElement
in class org.xml.sax.helpers.DefaultHandler
uri
- the URI.localName
- the element type name.qName
- the name.
org.xml.sax.SAXException
- Any SAX exception, possibly
wrapping another exception.ContentHandler.endElement(java.lang.String, java.lang.String, java.lang.String)
public void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.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 org.xml.sax.ContentHandler
startElement
in class org.xml.sax.helpers.DefaultHandler
uri
- the URI.localName
- the element type name.qName
- the name.attributes
- the specified or defaulted attributes.
org.xml.sax.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 java.lang.String getConfigProperty(java.lang.String key)
getConfigProperty
in interface Configuration
key
- the property key.
public java.lang.String getConfigProperty(java.lang.String key, java.lang.String defaultValue)
If the property is not defined in this configuration, the code will lookup the property in the parent configuration.
getConfigProperty
in interface Configuration
key
- the property key.defaultValue
- the default value.
public void setConfigProperty(java.lang.String key, java.lang.String value)
key
- the key.value
- the value.public void setHelperObject(java.lang.String key, java.lang.Object value)
key
- the key.value
- the value.public java.lang.Object getHelperObject(java.lang.String key)
key
- the key.
public abstract Parser getInstance()
public abstract java.lang.Object getResult()
public java.util.Iterator findPropertyKeys(java.lang.String prefix)
findPropertyKeys
in interface Configuration
prefix
- the prefix
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |