Skip to main content
quote from the referenced link
Source Link
gnat
  • 20.5k
  • 29
  • 117
  • 309

anAn excellent library for this sort of work is Apache Commons Configuration

provides a generic configuration interface which enables a Java 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
  • Windows INI files
  • Property list files (plist)
  • JNDI
  • JDBC Datasource
  • System properties
  • Applet parameters
  • Servlet parameters

Different configuration sources can be mixed using a ConfigurationFactory and a CompositeConfiguration. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extending AbstractConfiguration or AbstractFileConfiguration.

The full Javadoc API documentation is available here...

an excellent library for this sort of work is Apache Commons Configuration

An excellent library for this sort of work is Apache Commons Configuration

provides a generic configuration interface which enables a Java 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
  • Windows INI files
  • Property list files (plist)
  • JNDI
  • JDBC Datasource
  • System properties
  • Applet parameters
  • Servlet parameters

Different configuration sources can be mixed using a ConfigurationFactory and a CompositeConfiguration. Additional sources of configuration parameters can be created by using custom configuration objects. This customization can be achieved by extending AbstractConfiguration or AbstractFileConfiguration.

The full Javadoc API documentation is available here...

Source Link
Martijn Verburg
  • 22k
  • 1
  • 52
  • 81

an excellent library for this sort of work is Apache Commons Configuration