|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.configuration.AbstractConfiguration
org.apache.commons.configuration.HierarchicalConfiguration
org.apache.commons.configuration.HierarchicalDOM4JConfiguration
A specialized hierarchical configuration class that is able to parse XML documents using DOM4J.
The parsed document will be stored keeping its structure. The
contained properties can be accessed using all methods supported by
the base class HierarchicalProperties.
| Nested Class Summary |
| Nested classes inherited from class org.apache.commons.configuration.HierarchicalConfiguration |
HierarchicalConfiguration.CloneVisitor, HierarchicalConfiguration.DefinedKeysVisitor, HierarchicalConfiguration.DefinedVisitor, HierarchicalConfiguration.Node, HierarchicalConfiguration.NodeVisitor |
| Nested classes inherited from class org.apache.commons.configuration.AbstractConfiguration |
AbstractConfiguration.Container, AbstractConfiguration.PropertiesTokenizer |
| Field Summary | |
private java.lang.String |
basePath
Stores the base path of this configuration. |
private java.lang.String |
file
Stores the file name of the document to be parsed. |
| Fields inherited from class org.apache.commons.configuration.HierarchicalConfiguration |
|
| Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
defaults, END_TOKEN, START_TOKEN |
| Constructor Summary | |
HierarchicalDOM4JConfiguration()
Creates a new instance of HierarchicalDOM4JConfiguration. |
|
HierarchicalDOM4JConfiguration(Configuration defaults)
Creates a new instance of HierarchicalDOM4JConfiguration
and sets the default properties. |
|
| Method Summary | |
private void |
constructHierarchy(HierarchicalConfiguration.Node node,
org.dom4j.Element element)
Helper method for building the internal storage hierarchy. |
java.lang.String |
getBasePath()
Returns the base path. |
java.lang.String |
getFileName()
Returns the name of the file to be parsed by this object. |
void |
initProperties(org.dom4j.Document document)
Initializes this configuration from an XML document. |
void |
load()
Loads and parses an XML document. |
void |
load(java.net.URL url)
Loads and parses the specified XML document. |
private void |
processAttributes(HierarchicalConfiguration.Node node,
org.dom4j.Element element)
Helper method for constructing node objects for the attributes of the given XML element. |
void |
setBasePath(java.lang.String path)
Allows to set a base path. |
void |
setFileName(java.lang.String file)
Sets the name of the file to be parsed by this object. |
| Methods inherited from class org.apache.commons.configuration.HierarchicalConfiguration |
addNodes, addPropertyDirect, clearProperty, containsKey, createAddPath, fetchAddNode, fetchNodeList, findLastPathNode, findPropertyNodes, getKeys, getMaxIndex, getPropertyDirect, getRoot, isEmpty, nodeDefined, removeNode, setRoot, subset |
| Methods inherited from class org.apache.commons.configuration.AbstractConfiguration |
addProperty, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, interpolate, interpolateHelper, processString, setProperty, testBoolean |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
private java.lang.String file
private java.lang.String basePath
| Constructor Detail |
public HierarchicalDOM4JConfiguration()
HierarchicalDOM4JConfiguration.
public HierarchicalDOM4JConfiguration(Configuration defaults)
HierarchicalDOM4JConfiguration
and sets the default properties.
defaults - the default properties| Method Detail |
public java.lang.String getFileName()
public void setFileName(java.lang.String file)
file - the file to be parsedpublic java.lang.String getBasePath()
getBasePath in interface BasePathLoaderpublic void setBasePath(java.lang.String path)
setBasePath in interface BasePathLoaderpath - the base path; this can be a URL or a file path
public void load()
throws java.lang.Exception
java.lang.Exception - if an error occurs
public void load(java.net.URL url)
throws java.lang.Exception
url - the URL to the XML document
java.lang.Exception - if an error occurspublic void initProperties(org.dom4j.Document document)
document - the document to be parsed
private void constructHierarchy(HierarchicalConfiguration.Node node,
org.dom4j.Element element)
node - the actual nodeelement - the actual XML element
private void processAttributes(HierarchicalConfiguration.Node node,
org.dom4j.Element element)
node - the actual nodeelement - the actual XML element
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||