|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.configuration.AbstractConfiguration org.apache.commons.configuration.HierarchicalConfiguration org.apache.commons.configuration.HierarchicalXMLConfiguration
A specialized hierarchical configuration class that is able to parse XML documents.
The parsed document will be stored keeping its structure. The
contained properties can be accessed using all methods supported by
the base class HierarchicalConfiguration
.
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.PropertiesTokenizer |
Field Summary |
Fields inherited from class org.apache.commons.configuration.AbstractConfiguration |
END_TOKEN, START_TOKEN |
Constructor Summary | |
HierarchicalXMLConfiguration()
|
Method Summary | |
String |
getBasePath()
Return the base path. |
File |
getFile()
Return the file where the configuration is stored. |
String |
getFileName()
Return the name of the file. |
URL |
getURL()
Return the URL where the configuration is stored. |
void |
initProperties(Document document)
Initializes this configuration from an XML document. |
void |
load()
Load the configuration from the underlying URL. |
void |
load(File file)
Load the configuration from the specified file. |
void |
load(InputStream in)
Load the configuration from the specified stream, using the default platform specific encoding. |
void |
load(InputStream in,
String encoding)
Load the configuration from the specified stream, using the specified encoding. |
void |
load(Reader in)
Load the configuration from the specified reader. |
void |
load(String fileName)
Locate the specified file and load the configuration. |
void |
load(URL url)
Load the configuration from the specified URL. |
void |
save()
Save the configuration. |
void |
save(File file)
Save the configuration to the specified file. |
void |
save(OutputStream out)
Save the configuration to the specified stream. |
void |
save(OutputStream out,
String encoding)
Save the configuration to the specified stream, using the specified encoding. |
void |
save(String fileName)
Save the configuration to the specified file. |
void |
save(URL url)
Save the configuration to the specified URL if it's a file URL. |
void |
save(Writer out)
Save the configuration to the specified writer. |
void |
setBasePath(String basePath)
Set the base path. |
void |
setFile(File file)
Set the file where the configuration is stored. |
void |
setFileName(String fileName)
Set the name of the file. |
void |
setURL(URL url)
The URL where the configuration is stored. |
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, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, interpolate, interpolateHelper, isThrowExceptionOnMissing, setDelimiter, setProperty, setThrowExceptionOnMissing, split |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.commons.configuration.Configuration |
addProperty, clearProperty, containsKey, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getProperty, getShort, getShort, getShort, getString, getString, getStringArray, getVector, getVector, isEmpty, setProperty, subset |
Constructor Detail |
public HierarchicalXMLConfiguration()
Method Detail |
public void initProperties(Document document)
document
- the document to be parsedpublic void load() throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
ConfigurationException
public void load(String fileName) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
fileName
- the name of the file loaded
ConfigurationException
public void load(File file) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
file
- the loaded file
ConfigurationException
public void load(URL url) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
url
- the URL of the file loaded
ConfigurationException
public void load(InputStream in) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
in
- the input stream
ConfigurationException
public void load(InputStream in, String encoding) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
in
- the input streamencoding
- the encoding used. null
to use the default encoding
ConfigurationException
public void load(Reader in) throws ConfigurationException
FileConfiguration
load
in interface FileConfiguration
in
- the reader
ConfigurationException
public void save() throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
ConfigurationException
public void save(String fileName) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
fileName
-
ConfigurationException
public void save(File file) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
file
-
ConfigurationException
public void save(URL url) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
url
-
ConfigurationException
public void save(OutputStream out) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
out
-
ConfigurationException
public void save(OutputStream out, String encoding) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
out
- encoding
-
ConfigurationException
public void save(Writer out) throws ConfigurationException
FileConfiguration
save
in interface FileConfiguration
out
- the writer
ConfigurationException
public String getFileName()
FileConfiguration
getFileName
in interface FileConfiguration
public void setFileName(String fileName)
FileConfiguration
setFileName
in interface FileConfiguration
fileName
- the name of the filepublic String getBasePath()
FileConfiguration
getBasePath
in interface FileConfiguration
public void setBasePath(String basePath)
FileConfiguration
setBasePath
in interface FileConfiguration
basePath
- the base path.public File getFile()
FileConfiguration
getFile
in interface FileConfiguration
public void setFile(File file)
FileConfiguration
setFile
in interface FileConfiguration
file
- public URL getURL()
FileConfiguration
getURL
in interface FileConfiguration
public void setURL(URL url)
FileConfiguration
setURL
in interface FileConfiguration
url
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |