|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IConfig
The standard configuration interface. All configuration Services implement this interface, no matter what the source.
Field Summary | |
---|---|
static java.lang.String |
PTY_CONFIG
The name of the property for components using implementations of this interface. |
Method Summary | |
---|---|
boolean |
getBoolean(java.lang.String pProperty)
Reads the value of the propery and converts it to a boolean. |
boolean |
getBoolean(java.lang.String pProperty,
boolean pDefaultValue)
Reads the value of the propery and converts it to a boolean. |
double |
getDouble(java.lang.String pProperty)
Reads the value of the propery and converts it to a double. |
double |
getDouble(java.lang.String pProperty,
double pDefaultValue)
Reads the value of the propery and converts it to a double. |
int |
getInt(java.lang.String pProperty)
Reads the value of the propery and converts it to a integer. |
int |
getInt(java.lang.String pProperty,
int pDefaultValue)
Reads the value of the propery and converts it to a integer. |
long |
getLong(java.lang.String pProperty)
Reads the value of the propery and converts it to a long. |
long |
getLong(java.lang.String pProperty,
long pDefaultValue)
Reads the value of the propery and converts it to a long. |
java.util.Properties |
getProperties()
Extracts all the available properties to a convenient format. |
java.lang.String |
getString(java.lang.String pProperty)
Reads the value of the propery and converts it to a String. |
java.lang.String |
getString(java.lang.String pProperty,
java.lang.Object[] pParams)
Retrieves a Message String from the configuration file and
converts it into a String . |
java.lang.String |
getString(java.lang.String pProperty,
java.lang.Object[] pParams,
java.lang.String pDefaultValue)
Retrieves a Message String from the configuration file and
converts it into a String . |
java.lang.String |
getString(java.lang.String pProperty,
java.lang.String pDefaultValue)
Reads the value of the propery and converts it to a String. |
java.util.StringTokenizer |
getStrings(java.lang.String pProperty)
Reads the value of the property and returns a StringTokenizer object. |
boolean |
isAvailable(java.lang.String pProperty)
Convenience method to check if a specific property is defined. |
void |
refresh()
Reload the properties from the properties file. |
Field Detail |
---|
static final java.lang.String PTY_CONFIG
Method Detail |
---|
boolean isAvailable(java.lang.String pProperty) throws RaccoonException
pProperty
- the property to search for.
RaccoonException
- if this component is active.boolean getBoolean(java.lang.String pProperty) throws RaccoonException, java.lang.NumberFormatException
true
if the value of the property
is a String(true)
or is 1
.
This method will return false
if the value of the property
is a String(false)
or is 0
.
pProperty
- the property to look for
RaccoonException
- if the property couldn't be found
java.lang.NumberFormatException
- if the specified property isn't a boolean.boolean getBoolean(java.lang.String pProperty, boolean pDefaultValue)
true
if the value of the property
is a String(true)
or is 1
.
This method will return false
if the value of the property
is a String(false)
or is 0
.
This method will return pDefaultvalue
if any error occurs.
pProperty
- the property to look forpDefaultValue
- the default value returned if the property is not
found in the config file
int getInt(java.lang.String pProperty) throws RaccoonException, java.lang.NumberFormatException
pProperty
- the property to look for
RaccoonException
- if the property couldn't be found
java.lang.NumberFormatException
- if the specified property isn't a int.int getInt(java.lang.String pProperty, int pDefaultValue)
pDefaultvalue
if any error occurs.
pProperty
- the property to look forpDefaultValue
- the default value returned if the property is not
found in the config file
long getLong(java.lang.String pProperty) throws RaccoonException, java.lang.NumberFormatException
pProperty
- the property to look for
RaccoonException
- if the property couldn't be found
java.lang.NumberFormatException
- if the specified property isn't a long.long getLong(java.lang.String pProperty, long pDefaultValue)
pDefaultvalue
if any error occurs.
pProperty
- the property to look forpDefaultValue
- the default value returned if the property is not
found in the config file
double getDouble(java.lang.String pProperty) throws RaccoonException
pProperty
- the property to look for
RaccoonException
- if the value can't be found or is invalid.double getDouble(java.lang.String pProperty, double pDefaultValue)
pDefaultvalue
if any error occurs.
pProperty
- the property to look forpDefaultValue
- the default value returned if the property is not
found in the config file
java.util.StringTokenizer getStrings(java.lang.String pProperty) throws RaccoonException
pProperty
- the property for which the data is required.
RaccoonException
- if the property couldn't be found.java.lang.String getString(java.lang.String pProperty) throws RaccoonException
pProperty
- the property to look for
RaccoonException
- if the value is an invalid Stringjava.lang.String getString(java.lang.String pProperty, java.lang.String pDefaultValue)
pDefaultvalue
if any error occurs.
pProperty
- the property to look forpDefaultValue
- the default value returned if the property is not
found in the config file
java.lang.String getString(java.lang.String pProperty, java.lang.Object[] pParams) throws RaccoonException
Message String
from the configuration file and
converts it into a String
.
A Message String
is a specific String
, because
each occurrence of {i} in that String will be replaced by
Object[i].toString()
For example:
property = "Hello {0}, you have {1}, new Object[] {"Kathleen", "mail"}
String
being returned:
"Hello Kathleen, you have mail"
No matter what the implementation behind the scenes is.
pProperty
- the property that is to be retrieved.pParams
- a list of objects implementing the toString() method that
will be inserted into the resulting String
RaccoonException
- if this method failsjava.lang.String getString(java.lang.String pProperty, java.lang.Object[] pParams, java.lang.String pDefaultValue)
Message String
from the configuration file and
converts it into a String
.
A Message String
is a specific String
, because
each occurrence of {i} in that String will be replaced by
Object[i].toString()
For example:
property = "Hello {0}, you have {1}, new Object[] {"Kathleen", "mail"}
String
being returned:
"Hello Kathleen, you have mail"
No matter what the implementation behind the scenes is.
This method will return pDefaultvalue
if any error occurs.
pProperty
- the property that is to be retrieved.pParams
- a list of objects implementing the toString() method that
will be inserted into the resulting String
pDefaultValue
- the default value returned if the property is not
found in the config file
void refresh() throws RaccoonException
RaccoonException
- if this component hasn't been initialised.java.util.Properties getProperties() throws RaccoonException
Properties
object
RaccoonException
- if the component isn't active
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |