A base root SAX handler.
addManualMapping
protected void addManualMapping(Class classToRead,
Class handler)
Adds a mapping between a class and the handler for the class.
classToRead
- the class.handler
- the handler class.
addMultiplexMapping
protected void addMultiplexMapping(Class baseClass,
String typeAttr,
MultiplexMappingEntry[] mdef)
Adds a multiplex mapping.
baseClass
- the base class.typeAttr
- the type attribute.mdef
- the mapping entry.
characters
public void characters(char[] ch,
int start,
int length)
throws SAXException
Process character data.
ch
- the character buffer.start
- the start index.length
- the length of the character data.
createHandler
public XmlReadHandler createHandler(Class classToRead,
String tagName,
Attributes atts)
throws XmlReaderException
Creates a SAX handler for the specified class.
classToRead
- the class.tagName
- the tag name.atts
- the attributes.
delegate
public void delegate(XmlReadHandler handler,
String tagName,
Attributes attrs)
throws XmlReaderException,
SAXException
Delegate to another handler.
handler
- the new handler.tagName
- the tag name.attrs
- the attributes.
endElement
public void endElement(String uri,
String localName,
String qName)
throws SAXException
Finish processing an element.
uri
- the URI.localName
- the local name.qName
- the qName.
getHelperObject
public Object getHelperObject(String key)
Returns an object from the registry.
getResult
public Object getResult()
throws SAXException
Returns the parse result. This method is called at the end of the
parsing process and expects the generated object.
- getResult in interface FrontendDefaultHandler
loadClass
protected Class loadClass(String className)
throws XmlReaderException
Loads the given class, and ignores all exceptions which may occur
during the loading. If the class was invalid, null is returned instead.
className
- the name of the class to be loaded.
loadHandlerClass
protected XmlReadHandler loadHandlerClass(String className)
throws XmlReaderException
Loads the given class, and ignores all exceptions which may occur
during the loading. If the class was invalid, null is returned instead.
className
- the name of the class to be loaded.
recurse
public void recurse(XmlReadHandler handler,
String tagName,
Attributes attrs)
throws XmlReaderException,
SAXException
Start a new handler stack and delegate to another handler.
handler
- the handler.tagName
- the tag name.attrs
- the attributes.
setHelperObject
public void setHelperObject(String key,
Object value)
Adds an object to the registry.
key
- the key.value
- the object.
startDocument
public void startDocument()
throws SAXException
Starts processing a document.
startElement
public void startElement(String uri,
String localName,
String qName,
Attributes attributes)
throws SAXException
Starts processing an element.
uri
- the URI.localName
- the local name.qName
- the qName.attributes
- the attributes.
unwind
public void unwind(String tagName)
throws SAXException,
XmlReaderException
Hand control back to the previous handler.