Class HierarchicalConfigurationXMLReader<T>
- java.lang.Object
-
- org.apache.commons.configuration2.ConfigurationXMLReader
-
- org.apache.commons.configuration2.HierarchicalConfigurationXMLReader<T>
-
- Type Parameters:
T
- the type of the nodes supported by this reader
- All Implemented Interfaces:
org.xml.sax.XMLReader
public class HierarchicalConfigurationXMLReader<T> extends ConfigurationXMLReader
A specialized SAX2 XML parser that "parses" hierarchical configuration objects.
This class mimics to be a SAX conform XML parser. Instead of parsing XML documents it processes a
Configuration
object and generates SAX events for the single properties defined there. This enables the whole world of XML processing for configuration objects.The
HierarchicalConfiguration
object to be parsed can be specified using a constructor or thesetConfiguration()
method. This object will be processed by theparse()
methods. Note that these methods ignore their argument.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private class
HierarchicalConfigurationXMLReader.SAXVisitor
A specialized visitor class for generating SAX events for a hierarchical node structure.
-
Field Summary
Fields Modifier and Type Field Description private HierarchicalConfiguration<T>
configuration
Stores the configuration object to be parsed.-
Fields inherited from class org.apache.commons.configuration2.ConfigurationXMLReader
NS_URI
-
-
Constructor Summary
Constructors Constructor Description HierarchicalConfigurationXMLReader()
Creates a new instance ofHierarchicalConfigurationXMLReader
.HierarchicalConfigurationXMLReader(HierarchicalConfiguration<T> config)
Creates a new instance ofHierarchicalConfigurationXMLReader
and sets the configuration to be parsed.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HierarchicalConfiguration<T>
getConfiguration()
Gets the configuration object to be parsed.Configuration
getParsedConfiguration()
Gets the configuration object to be processed.protected void
processKeys()
Processes the actual configuration object to generate SAX parsing events.void
setConfiguration(HierarchicalConfiguration<T> config)
Sets the configuration object to be parsed.-
Methods inherited from class org.apache.commons.configuration2.ConfigurationXMLReader
fireCharacters, fireElementEnd, fireElementStart, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getException, getFeature, getProperty, getRootName, parse, parse, parseConfiguration, setContentHandler, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setProperty, setRootName
-
-
-
-
Field Detail
-
configuration
private HierarchicalConfiguration<T> configuration
Stores the configuration object to be parsed.
-
-
Constructor Detail
-
HierarchicalConfigurationXMLReader
public HierarchicalConfigurationXMLReader()
Creates a new instance ofHierarchicalConfigurationXMLReader
.
-
HierarchicalConfigurationXMLReader
public HierarchicalConfigurationXMLReader(HierarchicalConfiguration<T> config)
Creates a new instance ofHierarchicalConfigurationXMLReader
and sets the configuration to be parsed.- Parameters:
config
- the configuration object
-
-
Method Detail
-
getConfiguration
public HierarchicalConfiguration<T> getConfiguration()
Gets the configuration object to be parsed.- Returns:
- the configuration object to be parsed
-
getParsedConfiguration
public Configuration getParsedConfiguration()
Gets the configuration object to be processed.- Specified by:
getParsedConfiguration
in classConfigurationXMLReader
- Returns:
- the actual configuration object
-
processKeys
protected void processKeys()
Processes the actual configuration object to generate SAX parsing events.- Specified by:
processKeys
in classConfigurationXMLReader
-
setConfiguration
public void setConfiguration(HierarchicalConfiguration<T> config)
Sets the configuration object to be parsed.- Parameters:
config
- the configuration object to be parsed
-
-