net.sourceforge.jabm.util
Class SystemProperties

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 net.sourceforge.jabm.util.SystemProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class SystemProperties
extends java.util.Properties

A set of property bindings that are initialised from system properties passed on the command line (typically using the "-D" option). All property names are assumed to be in the form basename.suffix where basename is common to all properties. The basename will typically correspond to the name of a class or application. When constructing the class a set of legal suffixes is specified. If a system property is found with the specified but an illegal suffix then an IllegalArgumentExpcetion will be thrown.

See Also:
System.getProperty()

, Serialized Form
 

Field Summary
protected  java.lang.String baseName
           
static java.lang.String[] jabmProperties
           
protected static SystemProperties jabsConfiguration
           
static java.lang.String PROPERTY_BASE
           
static java.lang.String PROPERTY_BASE_DIR_NAME
           
static java.lang.String PROPERTY_CONFIG
           
static java.lang.String PROPERTY_CONFIG_ONLY
           
static java.lang.String PROPERTY_PROPFILE
           
static java.lang.String PROPERTY_SEED_MASK
           
static java.lang.String PROPERTY_SEEDS
           
static java.lang.String PROPERTY_VARFILE
           
protected  java.util.Set<java.lang.String> propertyNames
           
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
SystemProperties(java.lang.String baseName, java.util.Collection<java.lang.String> propertyNames)
           
SystemProperties(java.lang.String baseName, java.util.Set<java.lang.String> propertyNames, java.util.HashMap<java.lang.String,java.lang.String> defaultBindings)
           
SystemProperties(java.lang.String baseName, java.lang.String[] propertyNames)
           
 
Method Summary
static SystemProperties jabsConfiguration()
           
 void readSystemProperties()
           
 
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, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

baseName

protected java.lang.String baseName

propertyNames

protected java.util.Set<java.lang.String> propertyNames

jabsConfiguration

protected static SystemProperties jabsConfiguration

PROPERTY_BASE

public static final java.lang.String PROPERTY_BASE
See Also:
Constant Field Values

PROPERTY_BASE_DIR_NAME

public static final java.lang.String PROPERTY_BASE_DIR_NAME
See Also:
Constant Field Values

PROPERTY_PROPFILE

public static final java.lang.String PROPERTY_PROPFILE
See Also:
Constant Field Values

PROPERTY_CONFIG_ONLY

public static final java.lang.String PROPERTY_CONFIG_ONLY
See Also:
Constant Field Values

PROPERTY_VARFILE

public static final java.lang.String PROPERTY_VARFILE
See Also:
Constant Field Values

PROPERTY_CONFIG

public static final java.lang.String PROPERTY_CONFIG
See Also:
Constant Field Values

PROPERTY_SEEDS

public static final java.lang.String PROPERTY_SEEDS
See Also:
Constant Field Values

PROPERTY_SEED_MASK

public static final java.lang.String PROPERTY_SEED_MASK
See Also:
Constant Field Values

jabmProperties

public static final java.lang.String[] jabmProperties
Constructor Detail

SystemProperties

public SystemProperties(java.lang.String baseName,
                        java.util.Set<java.lang.String> propertyNames,
                        java.util.HashMap<java.lang.String,java.lang.String> defaultBindings)
                 throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

SystemProperties

public SystemProperties(java.lang.String baseName,
                        java.util.Collection<java.lang.String> propertyNames)

SystemProperties

public SystemProperties(java.lang.String baseName,
                        java.lang.String[] propertyNames)
Method Detail

readSystemProperties

public void readSystemProperties()
                          throws java.lang.IllegalArgumentException
Throws:
java.lang.IllegalArgumentException

jabsConfiguration

public static SystemProperties jabsConfiguration()