org.pentaho.reporting.libraries.xmlns.parser

Class PropertiesReadHandler

public class PropertiesReadHandler extends AbstractXmlReadHandler

A read handler that creates property-structures (name-value-pairs) and returns the properties as java.util.Properties collection.

Author: Thomas Morgner

Constructor Summary
PropertiesReadHandler()
Creates a properties read-handler using "property" as child-tagname.
PropertiesReadHandler(String propertyTagName)
Creates a properties read-handler using the specified propertyTagName as child-tagname.
Method Summary
protected voiddoneParsing()
Done parsing.
protected XmlReadHandlergetHandlerForChild(String uri, String tagName, Attributes atts)
Returns the handler for a child element.
ObjectgetObject()
Returns the resulting properties collection, never null.
PropertiesgetResult()
Returns the resulting properties collection, never null.

Constructor Detail

PropertiesReadHandler

public PropertiesReadHandler()
Creates a properties read-handler using "property" as child-tagname.

PropertiesReadHandler

public PropertiesReadHandler(String propertyTagName)
Creates a properties read-handler using the specified propertyTagName as child-tagname.

Parameters: propertyTagName the tag name for the child elements that define the properties.

Method Detail

doneParsing

protected void doneParsing()
Done parsing.

Throws: SAXException if there is a parsing error.

getHandlerForChild

protected XmlReadHandler getHandlerForChild(String uri, 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.

getObject

public Object getObject()
Returns the resulting properties collection, never null.

Returns: the properties.

Throws: SAXException if there is a parsing error.

getResult

public Properties getResult()
Returns the resulting properties collection, never null.

Returns: the properties.