The Apache Jakarta Project has released Commons Configuration 1.6, a Java class library that
enables an application to read configuration data from a variety of sources. Commons Configuration provides typed access to single, and multi-valued configuration parameters as demonstrated by the following code:
Double double = config.getDouble("number"); Integer integer = config.getInteger("number");Configuration parameters may be loaded from the following sources:
- Properties files
- XML documents
- Property list files (.plist)
- JNDI
- JDBC Datasource
- System properties
- Applet parameters
- Servlet parameters
Different configuration sources can be mixed using a
ConfigurationFactory
and aCompositeConfiguration
. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extendingAbstractConfiguration
orAbstractFileConfiguration
.
According to Olive Heger, "This release is in line with the previous 1.5 release: there are no big changes or spectacular new features, but a lot of smaller bug fixes and enhancements. There are also a few new features, e.g. support for the xml:space attribute in XMLConfiguration, or multiple enhancements of DefaultConfigurationBuilder. All changes are source and binary compatible with the previous release."