|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openadaptor.util.SuperPropertiesUtils
public final class SuperPropertiesUtils
SuperPropertiesUtils - miscellaneous routines for accessing properties. The routines in this package can be used to retrieve property settings which have been "coerced" to the appropriate type such as int or boolean.
Appropriate logging and exception generation is performed automatically.
Example:
Properties props = System.getProperties ();
try
{
String myName = SuperPropertiesUtils.getStringProperty ("name");
boolean autoCleanup = SuperPropertiesUtils.getBooleanProperty ("cleanup", false);
}
catch (PropertyNotSetException pnse)
{
throw pnse;
}
catch (NumberFormatException nfe)
{
throw nfe;
}
Field Summary
(package private) static org.apache.log4j.Logger
log
Deprecated.
Constructor Summary
SuperPropertiesUtils(java.util.Properties props)
Deprecated. Constructs a SuperPropertiesUtils object.
Method Summary
boolean
getBooleanProperty(java.lang.String name)
Deprecated. Retrieves the boolean value of a property.
boolean
getBooleanProperty(java.lang.String name,
boolean defValue)
Deprecated. Retrieves the boolean value of a property.
boolean
getBooleanProperty(java.lang.String name,
boolean defValue,
boolean logit)
Deprecated.
byte
getByteProperty(java.lang.String name)
Deprecated. Retrieves the byte value of a property.
byte
getByteProperty(java.lang.String name,
byte defValue)
Deprecated. Retrieves the byte value of a property.
java.util.Date
getDateProperty(java.lang.String name)
Deprecated. Retrieves the date value of a property.
java.util.Date
getDateProperty(java.lang.String name,
java.util.Date defValue)
Deprecated. Retrieves the date value of a property.
double
getDoubleProperty(java.lang.String name)
Deprecated. Retrieves the double value of a property.
double
getDoubleProperty(java.lang.String name,
double defValue)
Deprecated. Retrieves the double value of a property.
float
getFloatProperty(java.lang.String name)
Deprecated. Retrieves the float value of a property.
float
getFloatProperty(java.lang.String name,
float defValue)
Deprecated. Retrieves the float value of a property.
int[]
getIntArrayProperty(java.lang.String name)
Deprecated. Retrieves the value of a property as an array of integers.
int
getIntProperty(java.lang.String name)
Deprecated. Retrieves the int value of a property.
int
getIntProperty(java.lang.String name,
int defValue)
Deprecated. Retrieves the int value of a property.
long
getLongProperty(java.lang.String name)
Deprecated. Retrieves the long value of a property.
long
getLongProperty(java.lang.String name,
long defValue)
Deprecated. Retrieves the long value of a property.
static java.lang.String
getMandatoryProperty(java.util.Properties props,
java.lang.String name)
Deprecated. Retrieve a property from properties object.
java.util.Properties
getProperties()
Deprecated. Returns the property object used to initialise this instance
java.lang.String
getPropertyProperty(java.lang.String name)
Deprecated. Retrieves the value of a property as a further property name.
short
getShortProperty(java.lang.String name)
Deprecated. Retrieves the short value of a property.
short
getShortProperty(java.lang.String name,
short defValue)
Deprecated. Retrieves the short value of a property.
java.lang.String[]
getStringArrayProperty(java.lang.String name)
Deprecated. Retrieves the value of a property as an array of integers.
java.lang.String[]
getStringArrayProperty(java.lang.String name,
boolean logit)
Deprecated.
java.lang.String
getStringProperty(java.lang.String name)
Deprecated. Retrieves the String value of a property.
java.lang.String
getStringProperty(java.lang.String name,
boolean logit)
Deprecated.
java.lang.String
getStringProperty(java.lang.String name,
java.lang.String defValue)
Deprecated. Retrieves the String value of a property.
java.lang.String
getStringProperty(java.lang.String name,
java.lang.String defValue,
boolean logit)
Deprecated.
boolean
propertyIsSet(java.lang.String name)
Deprecated. Determines if this property is set.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Field Detail
log
static org.apache.log4j.Logger log
- Deprecated.
Constructor Detail
SuperPropertiesUtils
public SuperPropertiesUtils(java.util.Properties props)
- Deprecated.
- Constructs a SuperPropertiesUtils object.
- Parameters:
props
- the Properties object to use.
Method Detail
propertyIsSet
public boolean propertyIsSet(java.lang.String name)
- Deprecated.
- Determines if this property is set.
- Parameters:
name
- the property to check
- Returns:
- true iff the property is set, false otherwise
getStringProperty
public java.lang.String getStringProperty(java.lang.String name)
throws PropertyNotSetException
- Deprecated.
- Retrieves the String value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the String value
- Throws:
PropertyNotSetException
- raised if the property is not set
getStringProperty
public java.lang.String getStringProperty(java.lang.String name,
boolean logit)
throws PropertyNotSetException
- Deprecated.
- Throws:
PropertyNotSetException
getStringProperty
public java.lang.String getStringProperty(java.lang.String name,
java.lang.String defValue)
- Deprecated.
- Retrieves the String value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the String value
getStringProperty
public java.lang.String getStringProperty(java.lang.String name,
java.lang.String defValue,
boolean logit)
- Deprecated.
getStringArrayProperty
public java.lang.String[] getStringArrayProperty(java.lang.String name)
throws PropertyNotSetException
- Deprecated.
- Retrieves the value of a property as an array of integers.
- Parameters:
name
- the property to retrieve
- Returns:
- the int[] value
- Throws:
PropertyNotSetException
- raised if the property is not set
getStringArrayProperty
public java.lang.String[] getStringArrayProperty(java.lang.String name,
boolean logit)
throws PropertyNotSetException
- Deprecated.
- Throws:
PropertyNotSetException
getIntArrayProperty
public int[] getIntArrayProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the value of a property as an array of integers.
- Parameters:
name
- the property to retrieve
- Returns:
- the int[] value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble an integer
getIntProperty
public int getIntProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the int value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the int value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble an integer
getIntProperty
public int getIntProperty(java.lang.String name,
int defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the int value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the int value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble an integer
getByteProperty
public byte getByteProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the byte value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the byte value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a byte
getByteProperty
public byte getByteProperty(java.lang.String name,
byte defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the byte value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the byte value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a byte
getDoubleProperty
public double getDoubleProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the double value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the double value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a double
getDoubleProperty
public double getDoubleProperty(java.lang.String name,
double defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the double value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the double value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a double
getFloatProperty
public float getFloatProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the float value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the float value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a float
getFloatProperty
public float getFloatProperty(java.lang.String name,
float defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the float value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the float value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a float
getLongProperty
public long getLongProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the long value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the long value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a long
getLongProperty
public long getLongProperty(java.lang.String name,
long defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the long value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the long value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a long
getShortProperty
public short getShortProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the short value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the short value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a short
getShortProperty
public short getShortProperty(java.lang.String name,
short defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the short value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the short value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a short
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the boolean value of a property.
Note that the following property values are treated as boolean true:
1, true, True, TRUE, yes, Yes, YES
0, false, False, FALSE, no, No, NO
- Parameters:
name
- the property to retrieve
- Returns:
- the boolean value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a boolean
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name,
boolean defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the boolean value of a property.
Note that the following property values are treated as boolean true:
1, true, True, TRUE, yes, Yes, YES
0, false, False, FALSE, no, No, NO
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the boolean value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a boolean
getBooleanProperty
public boolean getBooleanProperty(java.lang.String name,
boolean defValue,
boolean logit)
throws java.lang.NumberFormatException
- Deprecated.
- Throws:
java.lang.NumberFormatException
getPropertyProperty
public java.lang.String getPropertyProperty(java.lang.String name)
throws PropertyNotSetException
- Deprecated.
- Retrieves the value of a property as a further property name.
Note that the value of this property is examined to determine if it
is a sub-property name. If the value starts with a "+" character or
does not contain any "." characters then it is treated as a
sub-property name, otherwise it is returned as is.
Sub-property names are processed as follows:
Resource Name Resource Value Returned Value
x.otherProps y.generalProps y.generalProps
x.otherProps +y.generalProps x.y.generalProps
x.otherProps theProps x.theProps
x.otherProps +theProps x.theProps
- Parameters:
name
- the property to retrieve
- Returns:
- the String value
- Throws:
PropertyNotSetException
- raised if the property is not set
getDateProperty
public java.util.Date getDateProperty(java.lang.String name)
throws PropertyNotSetException,
java.lang.NumberFormatException
- Deprecated.
- Retrieves the date value of a property.
- Parameters:
name
- the property to retrieve
- Returns:
- the date value
- Throws:
PropertyNotSetException
- raised if the property is not set
java.lang.NumberFormatException
- raised if the property does not resemble a date
getDateProperty
public java.util.Date getDateProperty(java.lang.String name,
java.util.Date defValue)
throws java.lang.NumberFormatException
- Deprecated.
- Retrieves the date value of a property.
- Parameters:
name
- the property to retrievedefValue
- the default value to use if the property is not set
- Returns:
- the date value
- Throws:
java.lang.NumberFormatException
- raised if the property does not resemble a date
getProperties
public java.util.Properties getProperties()
- Deprecated.
- Returns the property object used to initialise this instance
getMandatoryProperty
public static java.lang.String getMandatoryProperty(java.util.Properties props,
java.lang.String name)
throws IbafException
- Deprecated.
- Retrieve a property from properties object. If it is not
found then an exception is raised otherwise the property value is
returned.
- Parameters:
props
- Properties object..name
- The name of the property to return.
- Returns:
- a string representation of the property value
- Throws:
IbafException
- if the property is not found
Overview
Package
Class
Tree
Deprecated
Index
Help
PREV CLASS
NEXT CLASS
FRAMES
NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD
DETAIL: FIELD | CONSTR | METHOD