org.jfree.xml.parser

Class AbstractXmlReadHandler

Implemented Interfaces:
XmlReadHandler
Known Direct Subclasses:
Base64ReadHandler, BasicStrokeReadHandler, ColorReadHandler, FontReadHandler, GenericReadHandler, GradientPaintReadHandler, InsetsReadHandler, ListReadHandler, NullReadHandler, ObjectRefHandler, Point2DReadHandler, Rectangle2DReadHandler, RenderingHintsReadHandler, RenderingHintValueReadHandler, StringReadHandler

public abstract class AbstractXmlReadHandler
extends java.lang.Object
implements XmlReadHandler

A base class for implementing an XmlReadHandler.

Constructor Summary

AbstractXmlReadHandler()
Creates a new handler.

Method Summary

void
characters(char[] ch, int start, int length)
This method is called to process the character data between element tags.
protected void
doneParsing()
Done parsing.
void
endElement(String tagName)
This method is called at the end of an element.
protected XmlReadHandler
getHandlerForChild(String tagName, Attributes atts)
Returns the handler for a child element.
RootXmlReadHandler
getRootHandler()
Returns the root handler for the parsing.
String
getTagName()
Returns the tag name.
void
init(RootXmlReadHandler rootHandler, String tagName)
Initialises the handler.
void
startElement(String tagName, Attributes attrs)
This method is called at the start of an element.
protected void
startParsing(Attributes attrs)
Starts parsing.

Constructor Details

AbstractXmlReadHandler

public AbstractXmlReadHandler()
Creates a new handler.

Method Details

characters

public void characters(char[] ch,
                       int start,
                       int length)
            throws SAXException
This method is called to process the character data between element tags.
Specified by:
characters in interface XmlReadHandler
Parameters:
ch - the character buffer.
start - the start index.
length - the length.

doneParsing

protected void doneParsing()
            throws SAXException,
                   XmlReaderException
Done parsing.
Throws:
XmlReaderException - if there is a reader error.

endElement

public final void endElement(String tagName)
            throws SAXException
This method is called at the end of an element.
Specified by:
endElement in interface XmlReadHandler
Parameters:
tagName - the tag name.

getHandlerForChild

protected XmlReadHandler getHandlerForChild(String tagName,
                                            Attributes atts)
            throws XmlReaderException,
                   SAXException
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:
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.
Specified by:
init in interface XmlReadHandler
Parameters:
rootHandler - the root handler.
tagName - the tag name.

startElement

public final void startElement(String tagName,
                               Attributes attrs)
            throws XmlReaderException,
                   SAXException
This method is called at the start of an element.
Specified by:
startElement in interface XmlReadHandler
Parameters:
tagName - the tag name.
attrs - the attributes.
Throws:
XmlReaderException - if there is a reader error.

startParsing

protected void startParsing(Attributes attrs)
            throws SAXException,
                   XmlReaderException
Starts parsing.
Parameters:
attrs - the attributes.