com.sun.mdm.index.configurator
Class Parameter

java.lang.Object
  extended bycom.sun.mdm.index.configurator.Parameter
All Implemented Interfaces:
java.lang.Cloneable, java.io.Serializable

public class Parameter
extends java.lang.Object
implements java.lang.Cloneable, java.io.Serializable

Represents a single parameter. Converts text values into actual Java objects.

See Also:
Serialized Form

Field Summary
protected  java.lang.String mName
          name
protected  java.lang.String mType
          type
protected  java.lang.String mValue
          value
 
Constructor Summary
Parameter(java.lang.String name, java.lang.String type, java.lang.String value)
          Creates new StrategyParameter.
 
Method Summary
(package private)  void checkType(java.lang.String type)
          Check if type is loadable using the current class loader and if it's one of the allowed types.
 java.lang.String getName()
          Returns the name of the parameter.
(package private) static java.lang.Object getObjectFromString(java.lang.String string, java.lang.Class type)
          Return the value object after conversion from string to specified type.
 java.lang.String getType()
          Returns the string representation of the parameter value type.
 java.lang.String getValue()
          Returns the original string representation of the value.
 java.lang.Object getValueObject()
          Return the value object after converted to the specified type.
 java.lang.Class getValueType()
          Return the class representing the value type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mName

protected java.lang.String mName
name


mType

protected java.lang.String mType
type


mValue

protected java.lang.String mValue
value

Constructor Detail

Parameter

public Parameter(java.lang.String name,
                 java.lang.String type,
                 java.lang.String value)
Creates new StrategyParameter.

Parameters:
name - Name of the parameter
type - Type of the parameter value, must match one of the allowed types.
value - Actual parameter value.
Method Detail

checkType

void checkType(java.lang.String type)
Check if type is loadable using the current class loader and if it's one of the allowed types.

Parameters:
type - string representation of the type.
Throws:
java.lang.IllegalArgumentException - if an error occurs.

getName

public java.lang.String getName()
Returns the name of the parameter.

Returns:
name of the parameter.

getObjectFromString

static java.lang.Object getObjectFromString(java.lang.String string,
                                            java.lang.Class type)
Return the value object after conversion from string to specified type.

Parameters:
string - Value as a string.
type - Type to convert to.
Returns:
value object.
Throws:
java.lang.IllegalArgumentException - if an error occurs.

getType

public java.lang.String getType()
Returns the string representation of the parameter value type.

Returns:
parameter value type.

getValue

public java.lang.String getValue()
Returns the original string representation of the value.

Returns:
value as string.

getValueObject

public java.lang.Object getValueObject()
Return the value object after converted to the specified type.

Returns:
value object.

getValueType

public java.lang.Class getValueType()
Return the class representing the value type.

Returns:
class of the value type.


Sun Microsystems, Inc.