Configuration, FileConfiguration, FileSystemBasedpublic class XMLPropertiesConfiguration extends PropertiesConfiguration
<?xml version="1.0"?> <!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> <properties> <comment>Description of the property list</comment> <entry key="key1">value1</entry> <entry key="key2">value2</entry> <entry key="key3">value3</entry> </properties>The Java 5.0 runtime is not required to use this class. The default encoding for this configuration format is UTF-8. Note that unlike
PropertiesConfiguration, XMLPropertiesConfiguration
does not support includes.
Note:Configuration objects of this type can be read concurrently
by multiple threads. However if one of these threads modifies the object,
synchronization has to be performed manually.PropertiesConfiguration.DefaultIOFactory, PropertiesConfiguration.IOFactory, PropertiesConfiguration.PropertiesReader, PropertiesConfiguration.PropertiesWriterEND_TOKEN, EVENT_ADD_PROPERTY, EVENT_CLEAR, EVENT_CLEAR_PROPERTY, EVENT_READ_PROPERTY, EVENT_SET_PROPERTY, START_TOKENautoSave, basePath, EVENT_CONFIG_CHANGED, EVENT_RELOAD, fileName, reloadLock, strategy| Constructor | Description |
|---|---|
XMLPropertiesConfiguration() |
Creates an empty XMLPropertyConfiguration object which can be
used to synthesize a new Properties file by adding values and
then saving().
|
XMLPropertiesConfiguration(java.io.File file) |
Creates and loads the xml properties from the specified file.
|
XMLPropertiesConfiguration(java.lang.String fileName) |
Creates and loads the xml properties from the specified file.
|
XMLPropertiesConfiguration(java.net.URL url) |
Creates and loads the xml properties from the specified URL.
|
XMLPropertiesConfiguration(org.w3c.dom.Element element) |
Creates and loads the xml properties from the specified DOM node.
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
load(java.io.Reader in) |
Load the properties from the given reader.
|
void |
load(org.w3c.dom.Element element) |
Parses a DOM element containing the properties.
|
void |
save(java.io.Writer out) |
Save the configuration to the specified stream.
|
void |
save(org.w3c.dom.Document document,
org.w3c.dom.Node parent) |
Writes the configuration as child to the given DOM node
|
addErrorLogListener, append, copy, createInterpolator, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDefaultListDelimiter, getDelimiter, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getInterpolator, getKeys, getList, getList, getListDelimiter, getLogger, getLong, getLong, getLong, getProperties, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, getSubstitutor, interpolate, interpolate, interpolatedConfiguration, interpolateHelper, isDelimiterParsingDisabled, isScalarValue, isThrowExceptionOnMissing, resolveContainerStore, setDefaultListDelimiter, setDelimiter, setDelimiterParsingDisabled, setListDelimiter, setLogger, setThrowExceptionOnMissing, subsetaddProperty, clearProperty, closeSilent, configurationChanged, containsKey, enterNoReload, exitNoReload, fireEvent, getBasePath, getFile, getFileName, getFileSystem, getKeys, getPath, getProperty, getReloadingStrategy, getReloadLock, getURL, isAutoSave, isEmpty, load, load, load, load, load, load, possiblySave, refresh, reload, reload, resetFileSystem, save, save, save, save, save, save, setAutoSave, setEncoding, setFile, setFileName, setFileSystem, setPath, setProperty, setReloadingStrategy, setURLaddPropertyDirect, clear, clearPropertyDirectclear, getBigDecimal, getBigDecimal, getBigInteger, getBigInteger, getBoolean, getBoolean, getBoolean, getByte, getByte, getByte, getDouble, getDouble, getDouble, getFloat, getFloat, getFloat, getInt, getInt, getInteger, getKeys, getList, getList, getLong, getLong, getLong, getProperties, getShort, getShort, getShort, getString, getString, getStringArray, subsetaddConfigurationListener, addErrorListener, clearConfigurationListeners, clearErrorListeners, createErrorEvent, createEvent, fireError, getConfigurationListeners, getErrorListeners, isDetailEvents, removeConfigurationListener, removeErrorListener, setDetailEventsequals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclone, createLayout, getEncoding, getFooter, getHeader, getInclude, getIncludesAllowed, getIOFactory, getLayout, isIncludesAllowed, setBasePath, setFooter, setHeader, setInclude, setIncludesAllowed, setIOFactory, setLayout, unescapeJavapublic XMLPropertiesConfiguration()
public XMLPropertiesConfiguration(java.lang.String fileName) throws ConfigurationException
fileName - The name of the properties file to load.ConfigurationException - Error while loading the properties filepublic XMLPropertiesConfiguration(java.io.File file) throws ConfigurationException
file - The properties file to load.ConfigurationException - Error while loading the properties filepublic XMLPropertiesConfiguration(java.net.URL url) throws ConfigurationException
url - The location of the properties file to load.ConfigurationException - Error while loading the properties filepublic XMLPropertiesConfiguration(org.w3c.dom.Element element) throws ConfigurationException
element - The DOM elementConfigurationException - Error while loading the properties filepublic void load(java.io.Reader in) throws ConfigurationException
PropertiesConfigurationclear() method is not called, so
the properties contained in the loaded file will be added to the
actual set of properties.load in interface FileConfigurationload in class PropertiesConfigurationin - An InputStream.ConfigurationException - if an error occurspublic void load(org.w3c.dom.Element element) throws ConfigurationException
element - The DOM elementConfigurationException - Error while interpreting the DOMpublic void save(java.io.Writer out) throws ConfigurationException
PropertiesConfigurationsave in interface FileConfigurationsave in class PropertiesConfigurationout - the output stream used to save the configurationConfigurationException - if an error occurspublic void save(org.w3c.dom.Document document, org.w3c.dom.Node parent)
document - The DOM document to add the configuration toparent - The DOM parent node