public class SubConfiguration extends java.lang.Object implements Configuration
Modifier and Type | Field and Description |
---|---|
protected Configuration |
cfg
Parent Configuration
|
protected java.lang.String |
prefix
prefix identifying the child parameters
|
Constructor and Description |
---|
SubConfiguration()
Creates a new empty SubConfiguration object
|
SubConfiguration(Configuration cfg,
java.lang.String prefix)
Creates a new SubConfiguration from its parent's Configuration
and the a given
prefix . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
get(java.lang.String propertyName) |
java.lang.String |
get(java.lang.String propertyName,
java.lang.String defaultValue) |
java.lang.String[] |
getAll(java.lang.String propertyName) |
boolean |
getBoolean(java.lang.String propertyName) |
boolean |
getBoolean(java.lang.String propertyName,
boolean defaultValue) |
boolean[] |
getBooleans(java.lang.String propertyName) |
double |
getDouble(java.lang.String propertyName) |
double |
getDouble(java.lang.String propertyName,
double defaultValue) |
double[] |
getDoubles(java.lang.String propertyName) |
int |
getInt(java.lang.String propertyName) |
int |
getInt(java.lang.String propertyName,
int defaultValue) |
int[] |
getInts(java.lang.String propertyName) |
long |
getLong(java.lang.String propertyName) |
long |
getLong(java.lang.String propertyName,
long defaultValue) |
long[] |
getLongs(java.lang.String propertyName) |
java.lang.Object |
getObject(java.lang.String propertyName)
Creates a new object, it takes the class from the value of the property
propertyName |
java.util.Set<java.lang.String> |
keySet() |
void |
put(java.lang.String name,
java.lang.Object value) |
void |
setConfiguration(Configuration newCfg)
Sets the container configuration.
|
void |
setPrefix(java.lang.String newPrefix)
Sets the prefix that identifies the parameters of the child object
inside the parent configuration.
|
protected Configuration cfg
protected java.lang.String prefix
public SubConfiguration()
public SubConfiguration(Configuration cfg, java.lang.String prefix)
prefix
.cfg
- Parent's Configurationprefix
- prefix identifying child parameters.public void setConfiguration(Configuration newCfg)
newCfg
- New container configuration.public void setPrefix(java.lang.String newPrefix)
newPrefix
- New prefixpublic java.lang.String get(java.lang.String propertyName)
get
in interface Configuration
public java.lang.String[] getAll(java.lang.String propertyName)
getAll
in interface Configuration
propertyName
- dittopublic int[] getInts(java.lang.String propertyName)
getInts
in interface Configuration
public long[] getLongs(java.lang.String propertyName)
getLongs
in interface Configuration
public double[] getDoubles(java.lang.String propertyName)
getDoubles
in interface Configuration
public boolean[] getBooleans(java.lang.String propertyName)
getBooleans
in interface Configuration
public java.lang.String get(java.lang.String propertyName, java.lang.String defaultValue)
get
in interface Configuration
public boolean getBoolean(java.lang.String propertyName)
getBoolean
in interface Configuration
public boolean getBoolean(java.lang.String propertyName, boolean defaultValue)
getBoolean
in interface Configuration
public double getDouble(java.lang.String propertyName)
getDouble
in interface Configuration
public double getDouble(java.lang.String propertyName, double defaultValue)
getDouble
in interface Configuration
public long getLong(java.lang.String propertyName)
getLong
in interface Configuration
public long getLong(java.lang.String propertyName, long defaultValue)
getLong
in interface Configuration
public int getInt(java.lang.String propertyName)
getInt
in interface Configuration
public int getInt(java.lang.String propertyName, int defaultValue)
getInt
in interface Configuration
public void put(java.lang.String name, java.lang.Object value)
put
in interface Configuration
name
- the Property namevalue
- typically a String, but could be a String[] toopublic java.lang.Object getObject(java.lang.String propertyName) throws ConfigurationException
propertyName
propertyName
- Property whose value is the class name of
the object being created.ConfigurationException
public java.util.Set<java.lang.String> keySet()
keySet
in interface Configuration