jPOS 1.6.1 API Documentation

org.jpos.core
Class SubConfiguration

java.lang.Object
  extended by org.jpos.core.SubConfiguration
All Implemented Interfaces:
Configuration

public class SubConfiguration
extends java.lang.Object
implements 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.

Version:
$Id: SubConfiguration.java 2594 2008-01-22 16:41:31Z apr $
Author:
Andr?s Alcarraz

Constructor Summary
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.
 
Method Summary
 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
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SubConfiguration

public SubConfiguration()
Creates a new empty SubConfiguration object


SubConfiguration

public SubConfiguration(Configuration cfg,
                        java.lang.String prefix)
Creates a new SubConfiguration from its parent's Configuration and the a given prefix.

Parameters:
cfg - Parent's Configuration
prefix - prefix identifying child parameters.
Method Detail

setConfiguration

public void setConfiguration(Configuration newCfg)
Sets the container configuration.

Parameters:
newCfg - New container configuration.

setPrefix

public void setPrefix(java.lang.String newPrefix)
Sets the prefix that identifies the parameters of the child object inside the parent configuration.

Parameters:
newPrefix - New prefix

get

public java.lang.String get(java.lang.String propertyName)
Specified by:
get in interface Configuration

getAll

public java.lang.String[] getAll(java.lang.String propertyName)
Specified by:
getAll in interface Configuration
Parameters:
propertyName - ditto
Returns:
all properties with a given name (or a zero length string)

getInts

public int[] getInts(java.lang.String propertyName)
Specified by:
getInts in interface Configuration

getLongs

public long[] getLongs(java.lang.String propertyName)
Specified by:
getLongs in interface Configuration

getDoubles

public double[] getDoubles(java.lang.String propertyName)
Specified by:
getDoubles in interface Configuration

getBooleans

public boolean[] getBooleans(java.lang.String propertyName)
Specified by:
getBooleans in interface Configuration

get

public java.lang.String get(java.lang.String propertyName,
                            java.lang.String defaultValue)
Specified by:
get in interface Configuration

getBoolean

public boolean getBoolean(java.lang.String propertyName)
Specified by:
getBoolean in interface Configuration

getBoolean

public boolean getBoolean(java.lang.String propertyName,
                          boolean defaultValue)
Specified by:
getBoolean in interface Configuration

getDouble

public double getDouble(java.lang.String propertyName)
Specified by:
getDouble in interface Configuration

getDouble

public double getDouble(java.lang.String propertyName,
                        double defaultValue)
Specified by:
getDouble in interface Configuration

getLong

public long getLong(java.lang.String propertyName)
Specified by:
getLong in interface Configuration

getLong

public long getLong(java.lang.String propertyName,
                    long defaultValue)
Specified by:
getLong in interface Configuration

getInt

public int getInt(java.lang.String propertyName)
Specified by:
getInt in interface Configuration

getInt

public int getInt(java.lang.String propertyName,
                  int defaultValue)
Specified by:
getInt in interface Configuration

put

public void put(java.lang.String name,
                java.lang.Object value)
Specified by:
put in interface Configuration
Parameters:
name - the Property name
value - typically a String, but could be a String[] too

getObject

public java.lang.Object getObject(java.lang.String propertyName)
                           throws ConfigurationException
Creates a new object, it takes the class from the value of the property propertyName

Parameters:
propertyName - Property whose value is the class name of the object being created.
Throws:
ConfigurationException

jPOS.org