|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.objectledge.parameters.ScopedParameters
public class ScopedParameters
An implementation of parameters decorator class to scope parameters key names.
| Field Summary | |
|---|---|
private Parameters |
parameters
the base parameters |
private String |
prefix
prefix |
| Constructor Summary | |
|---|---|
ScopedParameters(Parameters parameters,
String prefix)
Create the container scoped decorator. |
|
| Method Summary | |
|---|---|
void |
add(Parameters parameters,
boolean overwrite)
Adds all parameters from another container to this container. |
void |
add(String name,
boolean value)
Add the parameter. |
void |
add(String name,
boolean[] values)
Add the parameter. |
void |
add(String name,
Date value)
Add the parameter. |
void |
add(String name,
Date[] values)
Add the parameter. |
void |
add(String name,
float value)
Add the parameter. |
void |
add(String name,
float[] values)
Add the parameter. |
void |
add(String name,
int value)
Add the parameter. |
void |
add(String name,
int[] values)
Add the parameter. |
void |
add(String name,
long value)
Add the parameter. |
void |
add(String name,
long[] values)
Add the parameter. |
void |
add(String name,
String value)
Add the parameter. |
void |
add(String name,
String[] values)
Add the parameter. |
String |
get(String name)
Return the parameter with specified name. |
String |
get(String name,
String defaultValue)
Return the parameter with specified name. |
boolean |
getBoolean(String name)
Return the parameter with specified name. |
boolean |
getBoolean(String name,
boolean defaultValue)
Return the parameter with specified name. |
boolean[] |
getBooleans(String name)
Return all values of the parameter with specified name as an array. |
Parameters |
getChild(String prefix)
Return a parameters object that represents a subset of parameters with specified prefix. |
Date |
getDate(String name)
Return the parameter with specified name. |
Date |
getDate(String name,
Date defaultValue)
Return the parameter with specified name. |
Date[] |
getDates(String name)
Return all values of the parameter with specified name as an array. |
float |
getFloat(String name)
Return the parameter with specified name. |
float |
getFloat(String name,
float defaultValue)
Return the parameter with specified name. |
float[] |
getFloats(String name)
Return all values of the parameter with specified name as an array. |
int |
getInt(String name)
Return the parameter with specified name. |
int |
getInt(String name,
int defaultValue)
Return the parameter with specified name. |
int[] |
getInts(String name)
Return all values of the parameter with specified name as an array. |
long |
getLong(String name)
Return the parameter with specified name. |
long |
getLong(String name,
long defaultValue)
Return the parameter with specified name. |
long[] |
getLongs(String name)
Return the parameter as array of long values. |
String[] |
getParameterNames()
Return the names of all parameters. |
protected String |
getPrefix()
Get the prefix. |
String[] |
getStrings(String name)
Return all values of the parameter with specified name as an array. |
boolean |
isDefined(String name)
Checks whether parameter is defined. |
void |
remove()
Remove all parameters. |
void |
remove(Set<String> keys)
Remove all parameters with a name contained in given set. |
void |
remove(String name)
Remove all parameters with a specified name. |
void |
remove(String name,
Date value)
Remove all parameters with a specified name and value. |
void |
remove(String name,
float value)
Remove all parameters with a specified name and value. |
void |
remove(String name,
int value)
Remove all parameters with a specified name and value. |
void |
remove(String name,
long value)
Remove all parameters with a specified name and value. |
void |
remove(String name,
String value)
Remove all parameters with a specified name and string value. |
void |
removeExcept(Set<String> keys)
Remove all except those with a keys specified in the set. |
void |
set(Parameters parameters)
Reset state to equal with given parameters. |
void |
set(String name,
boolean value)
Set the parameter. |
void |
set(String name,
boolean[] values)
Set the parameter. |
void |
set(String name,
Date value)
Set the parameter. |
void |
set(String name,
Date[] values)
Set the parameter. |
void |
set(String name,
float value)
Set the parameter. |
void |
set(String name,
float[] values)
Set the parameter. |
void |
set(String name,
int value)
Set the parameter. |
void |
set(String name,
int[] values)
Set the parameter. |
void |
set(String name,
long value)
Set the parameter. |
void |
set(String name,
long[] values)
Set the parameter. |
void |
set(String name,
String value)
Set the parameter. |
void |
set(String name,
String[] values)
Set the parameter. |
String |
toString()
Returns the contained properties as a parsable String. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private Parameters parameters
private String prefix
| Constructor Detail |
|---|
public ScopedParameters(Parameters parameters,
String prefix)
parameters - the container to decorate.prefix - the scope prefix.| Method Detail |
|---|
public void add(Parameters parameters,
boolean overwrite)
true all conflicting
parameters from this container will be replaced,
otherwise all parameters from another container will be added.
add in interface Parametersparameters - the parameters object.overwrite - the overwrite switch.
public void add(String name,
boolean value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
boolean[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public void add(String name,
Date value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
Date[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public void add(String name,
float value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
float[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public void add(String name,
int value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
int[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public void add(String name,
long value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
long[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public void add(String name,
String value)
add in interface Parametersname - the parameter name.value - the parameter value.
public void add(String name,
String[] values)
add in interface Parametersname - the parameter name.values - the parameter values.
public String get(String name,
String defaultValue)
get in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public String get(String name)
get in interface Parametersname - the name of the parameter.
public boolean getBoolean(String name,
boolean defaultValue)
getBoolean in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public boolean getBoolean(String name)
getBoolean in interface Parametersname - the name of the parameter.
public boolean[] getBooleans(String name)
getBooleans in interface Parametersname - the name of the parameters.
public Parameters getChild(String prefix)
getChild in interface Parametersprefix - the prefix.
public Date getDate(String name)
getDate in interface Parametersname - the name of the parameter.
public Date getDate(String name,
Date defaultValue)
getDate in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public Date[] getDates(String name)
getDates in interface Parametersname - the name of the parameters.
public float getFloat(String name,
float defaultValue)
getFloat in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public float getFloat(String name)
throws NumberFormatException
getFloat in interface Parametersname - the name of the parameter.
NumberFormatException - if parameter is not a number.
public float[] getFloats(String name)
throws NumberFormatException
getFloats in interface Parametersname - the name of the parameters.
NumberFormatException - if anyone of the values is not a number.
public int getInt(String name,
int defaultValue)
getInt in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public int getInt(String name)
throws NumberFormatException
getInt in interface Parametersname - the name of the parameter.
NumberFormatException - if parameter is not a number.
public int[] getInts(String name)
throws NumberFormatException
getInts in interface Parametersname - the name of the parameters.
NumberFormatException - if anyone of the values is not a number.
public long getLong(String name,
long defaultValue)
getLong in interface Parametersname - the name of the parameter.defaultValue - the default value of the parameter.
public long getLong(String name)
throws NumberFormatException
getLong in interface Parametersname - the name of the parameter.
NumberFormatException - if parameter is not a number.
public long[] getLongs(String name)
throws NumberFormatException
getLongs in interface Parametersname - the name of the parameter.
NumberFormatException - if parameter is not a number.public String[] getParameterNames()
getParameterNames in interface Parameterspublic String[] getStrings(String name)
getStrings in interface Parametersname - the name of the parameters.
public boolean isDefined(String name)
isDefined in interface Parametersname - the name of the parameter.
true if parameter is defined.public void remove()
remove in interface Parameterspublic void remove(Set<String> keys)
remove in interface Parameterskeys - the set of keys.
public void remove(String name,
Date value)
remove in interface Parametersname - the parameter name.value - the parameter value.
public void remove(String name,
float value)
remove in interface Parametersname - the parameter name.value - the parameter value.
public void remove(String name,
int value)
remove in interface Parametersname - the parameter name.value - the parameter value.
public void remove(String name,
long value)
remove in interface Parametersname - the parameter name.value - the parameter value.
public void remove(String name,
String value)
remove in interface Parametersname - the parameter name.value - the parameter value.public void remove(String name)
remove in interface Parametersname - the parameter name.public void removeExcept(Set<String> keys)
removeExcept in interface Parameterskeys - the set of names.
public void set(String name,
boolean value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
boolean[] values)
set in interface Parametersname - the parameter name.values - the parameter values.
public void set(String name,
Date value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
Date[] values)
set in interface Parametersname - the parameter name.values - the parameter values.
public void set(String name,
float value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
float[] values)
set in interface Parametersname - the parameter name.values - the parameter values.
public void set(String name,
int value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
int[] values)
set in interface Parametersname - the parameter name.values - the parameter values.
public void set(String name,
long value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
long[] values)
set in interface Parametersname - the parameter name.values - the parameter values.
public void set(String name,
String value)
set in interface Parametersname - the parameter name.value - the parameter value.
public void set(String name,
String[] values)
set in interface Parametersname - the parameter name.values - the parameter values.public void set(Parameters parameters)
set in interface Parametersparameters - the source parameters.public String toString()
toString in interface ParameterstoString in class Objectprotected String getPrefix()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||