Class ExtendedProperties

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public class ExtendedProperties extends Properties
This implementation supports parameters substitution in property value.
Version:
$Id$
See Also:
  • Constructor Details

  • Method Details

    • getProperty

      public String getProperty(String key)
      Any parameter like ${propertyName} in property value will be replaced with the value of property with name propertyName.

      For example, for the following set of properties:

       param1=abcd
       param2=efgh
       param3=Alphabet starts with: ${param1}${param2}
       
      The call props.getProperty("param3") returns:
      Alphabet starts with: abcdefgh
      Note also that call props.get("param3") returns:
      Alphabet starts with: ${param1}${param2}
      So the Map.get(java.lang.Object) works as usual and returns raw (not expanded with substituted parameters) property value.

      Overrides:
      getProperty in class Properties
      See Also:
    • getProperty

      public String getProperty(String key, String defaultValue)
      Overrides:
      getProperty in class Properties
      See Also:
    • getSubset

      public ExtendedProperties getSubset(String prefix)
      Parameters:
      prefix - string, each property key should start with (this prefix will NOT be included into new key)
      Returns:
      sub-properties
    • getSubset

      public ExtendedProperties getSubset(String prefix, String newPrefix)
      Parameters:
      prefix - string, each property key should start with
      newPrefix - new prefix to be added to each key instead of existing prefix
      Returns:
      sub-properties