Class XMLPropertiesConfiguration

All Implemented Interfaces:
Cloneable, Configuration, FileConfiguration, FileSystemBased

This configuration implements the XML properties format introduced in Java 5.0, see http://java.sun.com/j2se/1.5.0/docs/api/java/util/Properties.html. An XML properties file looks like this:
 <?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.
Since:
1.1
Version:
$Id: XMLPropertiesConfiguration.java 1534399 2013-10-21 22:25:03Z henning $
Author:
Emmanuel Bourg, Alistair Young
  • Constructor Details

    • XMLPropertiesConfiguration

      Creates an empty XMLPropertyConfiguration object which can be used to synthesize a new Properties file by adding values and then saving(). An object constructed by this C'tor can not be tickled into loading included files because it cannot supply a base for relative includes.
    • XMLPropertiesConfiguration

      Creates and loads the xml properties from the specified file. The specified file can contain "include" properties which then are loaded and merged into the properties.
      Parameters:
      fileName - The name of the properties file to load.
      Throws:
      ConfigurationException - Error while loading the properties file
    • XMLPropertiesConfiguration

      Creates and loads the xml properties from the specified file. The specified file can contain "include" properties which then are loaded and merged into the properties.
      Parameters:
      file - The properties file to load.
      Throws:
      ConfigurationException - Error while loading the properties file
    • XMLPropertiesConfiguration

      Creates and loads the xml properties from the specified URL. The specified file can contain "include" properties which then are loaded and merged into the properties.
      Parameters:
      url - The location of the properties file to load.
      Throws:
      ConfigurationException - Error while loading the properties file
    • XMLPropertiesConfiguration

      Creates and loads the xml properties from the specified DOM node.
      Parameters:
      element - The DOM element
      Throws:
      ConfigurationException - Error while loading the properties file
      Since:
      2.0
  • Method Details