org.jfree.xml.parser

Class AbstractXmlReadHandler

public abstract class AbstractXmlReadHandler extends Object implements XmlReadHandler

A base class for implementing an XmlReadHandler.
Constructor Summary
AbstractXmlReadHandler()
Creates a new handler.
Method Summary
voidcharacters(char[] ch, int start, int length)
This method is called to process the character data between element tags.
protected voiddoneParsing()
Done parsing.
voidendElement(String tagName)
This method is called at the end of an element.
protected XmlReadHandlergetHandlerForChild(String tagName, Attributes atts)
Returns the handler for a child element.
RootXmlReadHandlergetRootHandler()
Returns the root handler for the parsing.
StringgetTagName()
Returns the tag name.
voidinit(RootXmlReadHandler rootHandler, String tagName)
Initialises the handler.
voidstartElement(String tagName, Attributes attrs)
This method is called at the start of an element.
protected voidstartParsing(Attributes attrs)
Starts parsing.

Constructor Detail

AbstractXmlReadHandler

public AbstractXmlReadHandler()
Creates a new handler.

Method Detail

characters

public void characters(char[] ch, int start, int length)
This method is called to process the character data between element tags.

Parameters: ch the character buffer. start the start index. length the length.

Throws: SAXException if there is a parsing error.

doneParsing

protected void doneParsing()
Done parsing.

Throws: SAXException if there is a parsing error. XmlReaderException if there is a reader error.

endElement

public final void endElement(String tagName)
This method is called at the end of an element.

Parameters: tagName the tag name.

Throws: SAXException if there is a parsing error.

getHandlerForChild

protected XmlReadHandler getHandlerForChild(String tagName, Attributes atts)
Returns the handler for a child element.

Parameters: tagName the tag name. atts the attributes.

Returns: the handler or null, if the tagname is invalid.

Throws: SAXException if there is a parsing error. XmlReaderException if there is a reader error.

getRootHandler

public RootXmlReadHandler getRootHandler()
Returns the root handler for the parsing.

Returns: the root handler.

getTagName

public String getTagName()
Returns the tag name.

Returns: the tag name.

init

public void init(RootXmlReadHandler rootHandler, String tagName)
Initialises the handler.

Parameters: rootHandler the root handler. tagName the tag name.

startElement

public final void startElement(String tagName, Attributes attrs)
This method is called at the start of an element.

Parameters: tagName the tag name. attrs the attributes.

Throws: SAXException if there is a parsing error. XmlReaderException if there is a reader error.

startParsing

protected void startParsing(Attributes attrs)
Starts parsing.

Parameters: attrs the attributes.

Throws: SAXException if there is a parsing error. XmlReaderException ?