org.apache.commons.configuration
public abstract class ConfigurationXMLReader extends Object implements XMLReader
A base class for "faked" XMLReader
classes
that transform a configuration object in a set of SAX parsing events.
This class provides dummy implementations for most of the methods
defined in the XMLReader
interface that are not used for this
special purpose. There will be concrete sub classes that process specific
configuration classes.
Version: $Id: ConfigurationXMLReader.java 439648 2006-09-02 20:42:10Z oheger $
Field Summary | |
---|---|
ContentHandler | contentHandler Stores the content handler. |
static String | DEFAULT_ROOT_NAME Constant for the default name of the root element. |
SAXException | exception Stores an exception that occurred during parsing. |
static Attributes | EMPTY_ATTRS An empty attributes object. |
protected static String | NS_URI Constant for the namespace URI. |
String | rootName Stores the name for the root element. |
Constructor Summary | |
---|---|
protected | ConfigurationXMLReader()
Creates a new instance of ConfigurationXMLReader . |
Method Summary | |
---|---|
protected void | fireCharacters(String text)
Fires a SAX characters event.
|
protected void | fireElementEnd(String name)
Fires a SAX element end event.
|
protected void | fireElementStart(String name, Attributes attribs)
Fires a SAX element start event.
|
ContentHandler | getContentHandler()
Returns the actually set content handler.
|
DTDHandler | getDTDHandler()
Returns the DTD handler. |
EntityResolver | getEntityResolver()
Returns the entity resolver. |
ErrorHandler | getErrorHandler()
Returns the error handler. |
SAXException | getException()
Returns a reference to an exception that occurred during parsing.
|
boolean | getFeature(String name)
Dummy implementation of the interface method.
|
abstract Configuration | getParsedConfiguration()
Returns a reference to the configuration that is parsed by this object.
|
Object | getProperty(String name)
Dummy implementation of the interface method. |
String | getRootName()
Returns the name to be used for the root element.
|
void | parse(String systemId)
Parses the acutal configuration object. |
void | parse(InputSource input)
Parses the acutal configuration object. |
protected void | parseConfiguration()
Parses the configuration object and generates SAX events. |
protected abstract void | processKeys()
Processes all keys stored in the actual configuration. |
void | setContentHandler(ContentHandler handler)
Sets the content handler. |
void | setDTDHandler(DTDHandler handler)
Sets the DTD handler. |
void | setEntityResolver(EntityResolver resolver)
Sets the entity resolver. |
void | setErrorHandler(ErrorHandler handler)
Sets the error handler. |
void | setFeature(String name, boolean value)
Dummy implementation of the interface method.
|
void | setProperty(String name, Object value)
Dummy implementation of the interface method. |
void | setRootName(String string)
Sets the name for the root element.
|
ConfigurationXMLReader
.Parameters: text the text
Parameters: name the name of the affected element
Parameters: name the name of the actual element attribs the attributes of this element (can be null)
Returns: the content handler
Returns: the DTD handler
Returns: the entity resolver
Returns: the error handler
Returns: a SAXExcpetion or null if none occurred
Parameters: name the name of the feature
Returns: always false (no features are supported)
Returns: the parsed configuration
Parameters: name the name of the requested property
Returns: the property value
Returns: the name for the root element
Parameters: systemId the system ID (ignored)
Throws: IOException if no configuration was specified SAXException if an error occurs during parsing
Parameters: input the input source (ignored)
Throws: IOException if no configuration was specified SAXException if an error occurs during parsing
Throws: IOException if no configuration has been specified SAXException if an error occurs during parsing
parseConfiguration()
to start the main parsing
process. parseConfiguration()
calls the content handler's
startDocument()
and endElement()
methods
and cares for exception handling. The remaining actions are left to this
method that must be implemented in a concrete sub class.
Throws: IOException if an IO error occurs SAXException if a SAX error occurs
Parameters: handler the content handler
Parameters: handler the handler to be set
Parameters: resolver the entity resolver
Parameters: handler the error handler
Parameters: name the name of the feature to be set value the value of the feature
Parameters: name the property name value the property value
Parameters: string the name for the root element.