Class SubConfiguration
java.lang.Object
org.jpos.core.SubConfiguration
- All Implemented Interfaces:
Configuration
SubConfiguration objects lets childs objects access attributes
in its parent object with a given prefix, for example "child.".
Child objects can access properties with their prefix removed.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ConfigurationParent Configurationprotected Stringprefix identifying the child parameters -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new empty SubConfiguration objectSubConfiguration(Configuration cfg, String prefix) Creates a new SubConfiguration from its parent's Configuration and the a givenprefix. -
Method Summary
Modifier and TypeMethodDescriptionString[]booleangetBoolean(String propertyName) booleangetBoolean(String propertyName, boolean defaultValue) boolean[]getBooleans(String propertyName) doubledoubledouble[]getDoubles(String propertyName) intintint[]longlonglong[]Creates a new object, it takes the class from the value of the propertypropertyNamekeySet()voidvoidsetConfiguration(Configuration newCfg) Sets the container configuration.voidSets the prefix that identifies the parameters of the child object inside the parent configuration.
-
Field Details
-
cfg
Parent Configuration -
prefix
-
-
Constructor Details
-
SubConfiguration
public SubConfiguration()Creates a new empty SubConfiguration object -
SubConfiguration
Creates a new SubConfiguration from its parent's Configuration and the a givenprefix.- Parameters:
cfg- Parent's Configurationprefix- prefix identifying child parameters.
-
-
Method Details
-
setConfiguration
Sets the container configuration.- Parameters:
newCfg- New container configuration.
-
setPrefix
-
get
- Specified by:
getin interfaceConfiguration
-
getAll
- Specified by:
getAllin interfaceConfiguration- Parameters:
propertyName- ditto- Returns:
- all properties with a given name (or a zero-length array)
-
getInts
- Specified by:
getIntsin interfaceConfiguration
-
getLongs
- Specified by:
getLongsin interfaceConfiguration
-
getDoubles
- Specified by:
getDoublesin interfaceConfiguration
-
getBooleans
- Specified by:
getBooleansin interfaceConfiguration
-
get
-
getBoolean
- Specified by:
getBooleanin interfaceConfiguration
-
getBoolean
- Specified by:
getBooleanin interfaceConfiguration
-
getDouble
- Specified by:
getDoublein interfaceConfiguration
-
getDouble
- Specified by:
getDoublein interfaceConfiguration
-
getLong
- Specified by:
getLongin interfaceConfiguration
-
getLong
- Specified by:
getLongin interfaceConfiguration
-
getInt
- Specified by:
getIntin interfaceConfiguration
-
getInt
- Specified by:
getIntin interfaceConfiguration
-
put
- Specified by:
putin interfaceConfiguration- Parameters:
name- the Property namevalue- typically a String, but could be a String[] too
-
getObject
Creates a new object, it takes the class from the value of the propertypropertyName- Parameters:
propertyName- Property whose value is the class name of the object being created.- Throws:
ConfigurationException
-
keySet
- Specified by:
keySetin interfaceConfiguration
-