|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.moremotion.config.ConfigParameter
public class ConfigParameter
Represents a Configuration Parameter and provides methods to convert the value of the
parameter to String, Password String, Expression, int, double, boolan and char. If the value of this parameter contains
embedded MScript functions resolve() method can be used to obtain a ConfigParameter object with a resolved value.
| Constructor Summary | |
|---|---|
ConfigParameter(org.w3c.dom.Element elm)
|
|
ConfigParameter(java.lang.String name,
java.lang.String value)
Creates new ConfigParameter with the given name and the value. |
|
| Method Summary | |
|---|---|
java.lang.String[] |
arrayValue()
|
java.lang.String[] |
arrayValue(java.lang.String[] defValue)
|
boolean |
booleanValue()
Converts the value of this parameter to boolean and returns it. |
boolean |
booleanValue(boolean defValue)
Converts the value of this parameter to boolean and returns it. |
char |
charValue()
|
char |
charValue(char defValue)
|
double |
doubleValue()
|
double |
doubleValue(double defValue)
|
Expression |
expressionValue()
Creates a Expression object from the value of this parameter and returns it. |
Expression |
expressionValue(Expression defValue)
Creates a Expression object from the value of this parameter and returns it. |
java.lang.String |
getName()
|
boolean |
hasMScript()
|
boolean |
hasValue()
|
int |
intValue()
|
int |
intValue(int defValue)
|
boolean |
isEmpty()
|
java.lang.String |
passwordValue()
Decrypts and returns the value |
java.lang.String |
passwordValue(java.lang.String defValue)
Decrypts and returns the value. |
ConfigParameter |
resolve(MoreMotionRequest request)
If the parameter value does not contain embedded MScript funcions this method simply return this object. |
java.lang.String |
stringValue()
|
java.lang.String |
stringValue(java.lang.String defValue)
|
ConfigParameter[] |
subParameters()
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConfigParameter(java.lang.String name,
java.lang.String value)
name - The name of the parametervalue - The value of the parameterpublic ConfigParameter(org.w3c.dom.Element elm)
| Method Detail |
|---|
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic boolean isEmpty()
true if this parameter contains no value false otherwisepublic boolean hasValue()
true if this parameter contains a value false otherwisepublic boolean hasMScript()
true if this parameter contains MScript false otherwise
public ConfigParameter resolve(MoreMotionRequest request)
throws ConfigParameterException
request - The MoreMotionRequest object required to resolve the MScript functions.
ConfigParameterException
public java.lang.String stringValue()
throws ConfigParameterException
ConfigParameterExceptionpublic java.lang.String stringValue(java.lang.String defValue)
defValue - the default value
defValue.
public java.lang.String passwordValue()
throws ConfigParameterException
ConfigParameterException
public java.lang.String passwordValue(java.lang.String defValue)
throws ConfigParameterException
defValue is returned.
defValue - The defult value to return in case of the parameter has no value.
ConfigParameterExceptionpublic Expression expressionValue()
public Expression expressionValue(Expression defValue)
defValue parameter is returned.
public int intValue()
throws ConfigParameterException
ConfigParameterException - if the value cannot be converted to integerpublic int intValue(int defValue)
defValue - The defult value
defValue is returned.
public double doubleValue()
throws ConfigParameterException
ConfigParameterException - if value cannot be converted to number.public double doubleValue(double defValue)
defValue - The defult double value
defValue is returned.
public boolean booleanValue()
throws ConfigParameterException
true.
If the value is case insensitive "false" or "no" or "0" then the result of the
convertion is false.
ConfigParameterException - if the value of this
parameter cannot be converted to booleanpublic boolean booleanValue(boolean defValue)
true.
If the value is case insensitive "false" or "no" or "0" then the result of the
convertion is false.
defValue - The default boolean value
defValue is returned.
public char charValue()
throws ConfigParameterException
ConfigParameterException - if the parameter contains no valuepublic char charValue(char defValue)
defValue is returned.
public java.lang.String[] arrayValue()
throws ConfigParameterException
ConfigParameterExceptionpublic java.lang.String[] arrayValue(java.lang.String[] defValue)
public ConfigParameter[] subParameters()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||