be.erwinsmout
Class MyProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by be.erwinsmout.MyProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>
Direct Known Subclasses:
DBConnectionProperties, DBObjectInterfaceGeneratorProperties, MyPropertiesInInsertionOrder, ProcessScriptProperties, ServerEngineProperties

public abstract class MyProperties
extends java.util.Properties

Author:
Erwin
See Also:
Serialized Form

Nested Class Summary
static class MyProperties.SKIPAUTOLOAD
           
 
Field Summary
static java.lang.String SUFFIX
           
 
Constructor Summary
MyProperties()
           
MyProperties(boolean resolveSystemPropertyReferences)
          Creates the Properties object, and tries to load it from one of the following places: A resource available to this' classloader A file in the directory pointed to by the user.dir system property A file in the directory pointed to by the user.home system property
MyProperties(MyProperties.SKIPAUTOLOAD skipAutoLoad)
          Constructor that skips the automatic loading process.
MyProperties(java.util.Properties defaults)
          Creates the MyProperties
MyProperties(java.util.Properties defaults, boolean resolveSystemPropertyReferences)
          Creates the MyProperties
 
Method Summary
static java.lang.String resolveSystemPropertyRefs(java.lang.String propertyValue)
          Resolves any references to System Properties in a String value by replacing the reference with the actual System Property value.
 
Methods inherited from class java.util.Properties
getProperty, getProperty, list, list, load, load, loadFromXML, propertyNames, save, setProperty, store, store, storeToXML, storeToXML, stringPropertyNames
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, toString, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SUFFIX

public static final java.lang.String SUFFIX
See Also:
Constant Field Values
Constructor Detail

MyProperties

public MyProperties()

MyProperties

public MyProperties(boolean resolveSystemPropertyReferences)
Creates the Properties object, and tries to load it from one of the following places:
  1. A resource available to this' classloader
  2. A file in the directory pointed to by the user.dir system property
  3. A file in the directory pointed to by the user.home system property

Parameters:
resolveSystemPropertyReferences - flag to indicate whether System property references (e.g.${user.home}) are to be resolved when loading the properties

MyProperties

public MyProperties(java.util.Properties defaults)
Creates the MyProperties

Parameters:
defaults -

MyProperties

public MyProperties(java.util.Properties defaults,
                    boolean resolveSystemPropertyReferences)
Creates the MyProperties

Parameters:
defaults -
resolveSystemPropertyReferences - flag to indicate whether System property references (e.g.${user.home}) are to be resolved when loading the properties

MyProperties

public MyProperties(MyProperties.SKIPAUTOLOAD skipAutoLoad)
Constructor that skips the automatic loading process.

Parameters:
skipAutoLoad - not used, except to distinguish this constructor from others
Method Detail

resolveSystemPropertyRefs

public static java.lang.String resolveSystemPropertyRefs(java.lang.String propertyValue)
Resolves any references to System Properties in a String value by replacing the reference with the actual System Property value. System Property references appear as a ${} sequence with the property name in between. They cannot be nested, i.e. the name of the property cannot be itself the result of resolving a nested property reference.

Parameters:
propertyValue - The String value to be resolved for System Property references
Returns:
The resolved String value