public abstract class RootXmlReadHandler extends FrontendDefaultHandler
CONTENTBASE_KEY
Constructor and Description |
---|
RootXmlReadHandler()
Creates a new root SAX handler.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addDefaultMappings()
Adds the default mappings.
|
protected void |
addManualMapping(Class classToRead,
Class handler)
Adds a mapping between a class and the handler for the class.
|
protected void |
addMultiplexMapping(Class baseClass,
String typeAttr,
MultiplexMappingEntry[] mdef)
Adds a multiplex mapping.
|
void |
characters(char[] ch,
int start,
int length)
Process character data.
|
XmlReadHandler |
createHandler(Class classToRead,
String tagName,
Attributes atts)
Creates a SAX handler for the specified class.
|
void |
delegate(XmlReadHandler handler,
String tagName,
Attributes attrs)
Delegate to another handler.
|
void |
endElement(String uri,
String localName,
String qName)
Finish processing an element.
|
protected XmlReadHandler |
getCurrentHandler()
Returns the current handler.
|
abstract ObjectFactory |
getFactoryLoader()
Returns the object factory.
|
Object |
getHelperObject(String key)
Returns an object from the registry.
|
Object |
getResult()
Returns ???.
|
protected XmlReadHandler |
getRootHandler()
Returns the root SAX handler.
|
protected Class |
loadClass(String className)
Loads the given class, and ignores all exceptions which may occur
during the loading.
|
protected XmlReadHandler |
loadHandlerClass(String className)
Loads the given class, and ignores all exceptions which may occur
during the loading.
|
void |
recurse(XmlReadHandler handler,
String tagName,
Attributes attrs)
Start a new handler stack and delegate to another handler.
|
void |
setHelperObject(String key,
Object value)
Adds an object to the registry.
|
protected void |
setRootHandler(XmlReadHandler handler)
Sets the root SAX handler.
|
void |
startDocument()
Starts processing a document.
|
void |
startElement(String uri,
String localName,
String qName,
Attributes attributes)
Starts processing an element.
|
void |
unwind(String tagName)
Hand control back to the previous handler.
|
clone, findPropertyKeys, getCommentHandler, getConfigProperties, getConfigProperty, getConfigProperty, getContentBase, getLocator, newInstance, setConfigProperty, setDocumentLocator
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
protected void addDefaultMappings()
public abstract ObjectFactory getFactoryLoader()
protected void addManualMapping(Class classToRead, Class handler)
classToRead
- the class.handler
- the handler class.protected void addMultiplexMapping(Class baseClass, String typeAttr, MultiplexMappingEntry[] mdef)
baseClass
- the base class.typeAttr
- the type attribute.mdef
- the mapping entry.public void setHelperObject(String key, Object value)
key
- the key.value
- the object.public Object getHelperObject(String key)
key
- the key.public XmlReadHandler createHandler(Class classToRead, String tagName, Attributes atts) throws XmlReaderException
classToRead
- the class.tagName
- the tag name.atts
- the attributes.XmlReaderException
- if there is a problem with the reader.protected void setRootHandler(XmlReadHandler handler)
handler
- the SAX handler.protected XmlReadHandler getRootHandler()
public void recurse(XmlReadHandler handler, String tagName, Attributes attrs) throws XmlReaderException, SAXException
handler
- the handler.tagName
- the tag name.attrs
- the attributes.XmlReaderException
- if there is a problem with the reader.SAXException
- if there is a problem with the parser.public void delegate(XmlReadHandler handler, String tagName, Attributes attrs) throws XmlReaderException, SAXException
handler
- the new handler.tagName
- the tag name.attrs
- the attributes.XmlReaderException
- if there is a problem with the reader.SAXException
- if there is a problem with the parser.public void unwind(String tagName) throws SAXException, XmlReaderException
tagName
- the tagname.SAXException
- if there is a problem with the parser.XmlReaderException
- if there is a problem with the reader.protected XmlReadHandler getCurrentHandler()
public void startDocument() throws SAXException
startDocument
in interface ContentHandler
startDocument
in class DefaultHandler
SAXException
- not in this implementation.public void startElement(String uri, String localName, String qName, Attributes attributes) throws SAXException
startElement
in interface ContentHandler
startElement
in class DefaultHandler
uri
- the URI.localName
- the local name.qName
- the qName.attributes
- the attributes.SAXException
- if there is a parsing problem.public void characters(char[] ch, int start, int length) throws SAXException
characters
in interface ContentHandler
characters
in class DefaultHandler
ch
- the character buffer.start
- the start index.length
- the length of the character data.SAXException
- if there is a parsing error.public void endElement(String uri, String localName, String qName) throws SAXException
endElement
in interface ContentHandler
endElement
in class DefaultHandler
uri
- the URI.localName
- the local name.qName
- the qName.SAXException
- if there is a parsing error.protected XmlReadHandler loadHandlerClass(String className) throws XmlReaderException
className
- the name of the class to be loaded.XmlReaderException
- if there is a reader error.protected Class loadClass(String className) throws XmlReaderException
className
- the name of the class to be loaded.XmlReaderException
- if there is a reader error.public Object getResult() throws SAXException
getResult
in class FrontendDefaultHandler
SAXException
- ???.Copyright © 2001–2018 JFree.org. All rights reserved.