org.moremotion.config
Class ConfigParameter

java.lang.Object
  extended by org.moremotion.config.ConfigParameter

public class ConfigParameter
extends java.lang.Object

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.

Version:
$Id: ConfigParameter.java 66 2008-03-14 18:06:09Z erkan $

Constructor Summary
ConfigParameter(java.lang.String name, java.lang.String value)
           
 
Method Summary
 boolean booleanValue()
           
 boolean booleanValue(boolean defValue)
           
 char charValue()
           
 char charValue(char defValue)
           
 double doubleValue()
           
 double doubleValue(double defValue)
           
 Expression expressionValue()
           
 Expression expressionValue(Expression defValue)
           
 boolean hasMScript()
           
 boolean hasValue()
           
 int intValue()
          Returns the value of the parameter as integer.
 int intValue(int defValue)
          Returns the value of the parameter as integer.
 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)
           
 java.lang.String toString()
           
 java.lang.String toString(java.lang.Object object)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigParameter

public ConfigParameter(java.lang.String name,
                       java.lang.String value)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

isEmpty

public boolean isEmpty()

hasValue

public boolean hasValue()

hasMScript

public boolean hasMScript()

resolve

public ConfigParameter resolve(MoreMotionRequest request)
                        throws ConfigParameterException
If the parameter value does not contain embedded MScript funcions this method simply return this object. If it does, it resolves the MScript functions in the strValue and creates a new copy of this object and returns it

Parameters:
request - The MoreMotionRequest object required to resolve the MScript functions.
Throws:
ConfigParameterException

stringValue

public java.lang.String stringValue()
                             throws ConfigParameterException
Throws:
ConfigParameterException

stringValue

public java.lang.String stringValue(java.lang.String defValue)

passwordValue

public java.lang.String passwordValue()
                               throws ConfigParameterException
Decrypts and returns the value

Throws:
ConfigParameterException

passwordValue

public java.lang.String passwordValue(java.lang.String defValue)
                               throws ConfigParameterException
Decrypts and returns the value. Parameter has no value then defValue is returned.

Parameters:
defValue - The defult value to return in case of the parameter has no value.
Throws:
ConfigParameterException

expressionValue

public Expression expressionValue()
                           throws ConfigParameterException
Throws:
ConfigParameterException

expressionValue

public Expression expressionValue(Expression defValue)

intValue

public int intValue()
             throws ConfigParameterException
Returns the value of the parameter as integer. If the value cannot be converted to a integer then ConfigParameterException is raised.

Throws:
ConfigParameterException

intValue

public int intValue(int defValue)
             throws ConfigParameterException
Returns the value of the parameter as integer. If parameter has no value then defValue is returned. If parameter has a vallue but the value cannot be converted to a integer then ConfigParameterException is raised.

Parameters:
defValue - The defult value to return in case of the parameter has no value.
Throws:
ConfigParameterException

doubleValue

public double doubleValue()
                   throws ConfigParameterException
Throws:
ConfigParameterException

doubleValue

public double doubleValue(double defValue)
                   throws ConfigParameterException
Throws:
ConfigParameterException

booleanValue

public boolean booleanValue()
                     throws ConfigParameterException
Throws:
ConfigParameterException

booleanValue

public boolean booleanValue(boolean defValue)
                     throws ConfigParameterException
Throws:
ConfigParameterException

charValue

public char charValue()
               throws ConfigParameterException
Throws:
ConfigParameterException

charValue

public char charValue(char defValue)
               throws ConfigParameterException
Throws:
ConfigParameterException

toString

public java.lang.String toString(java.lang.Object object)


Copyright © 2002-2008 MOR YAZILIM. All Rights Reserved.