planetj.dataengine.parameter
Class ParameterParameter

java.lang.Object
  |
  +--planetj.dataengine.parameter.AbstractParameter
        |
        +--planetj.dataengine.parameter.ParameterParameter
All Implemented Interfaces:
Cloneable, IJDBCSQLParameter, IParameter, Serializable

public class ParameterParameter
extends AbstractParameter
implements IJDBCSQLParameter

A parameter which gets its value from another parameter.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface planetj.dataengine.parameter.IParameter
CONTEXT_SPECIFIC_ID_END, CONTEXT_SPECIFIC_ID_START, DEFAULT_DATA_TYPE, ID_START, PARAMETER_INDEX_PREFIX
 
Constructor Summary
ParameterParameter()
           
 
Method Summary
 int getDataType()
          Gets the SQL data type of the parameter
 Object getValue()
          Gets the value of the parameter
 boolean isSQLParameter()
          Tests if this parameter should be sent as a parameter to the DB if it is included in a SQL statement.
 Object loadValueFromSource(Object o)
          Loads this parameter's value from a source.
 void setDataType(int newDataType)
          Sets the SQL data type of the parameter
 void setToken(String token)
          Sets the literal token that was used to denote this parameter in code
 void setValue(Object value)
          Sets the value of the parameter
 
Methods inherited from class planetj.dataengine.parameter.AbstractParameter
clearValue, clone, cloneParameter, equals, getCodeReplacementString, getContext, getContextIndex, getContextSpecificId, getDefaultValueAsString, getSource, getTargetFieldDescriptor, getToken, hashCode, setContext, setDefaultValueAsString, setSource, setSQLParameter, toString
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface planetj.dataengine.parameter.IJDBCSQLParameter
setSQLParameter
 
Methods inherited from interface planetj.dataengine.parameter.IParameter
clearValue, clone, cloneParameter, getCodeReplacementString, getContext, getContextIndex, getContextSpecificId, getSource, getTargetFieldDescriptor, getToken, setContext, setSource
 

Constructor Detail

ParameterParameter

public ParameterParameter()
Method Detail

getDataType

public int getDataType()
Gets the SQL data type of the parameter

Specified by:
getDataType in interface IParameter
Overrides:
getDataType in class AbstractParameter

getValue

public Object getValue()
Gets the value of the parameter

Specified by:
getValue in interface IParameter
Overrides:
getValue in class AbstractParameter

isSQLParameter

public boolean isSQLParameter()
Tests if this parameter should be sent as a parameter to the DB if it is included in a SQL statement. The DB can handle fewer type of parameters than the DataEngine, so not all DataEngine parameters can be sent as parameters to the DB. (For example, table names cannot be sent as DB parameters.) If this parameter is not part of an SQL statement then it does not matter what this method returns.

Specified by:
isSQLParameter in interface IJDBCSQLParameter
Overrides:
isSQLParameter in class AbstractParameter

loadValueFromSource

public Object loadValueFromSource(Object o)
                           throws CMException
Loads this parameter's value from a source. The object passed in may be ignored if the parameter already knows the source from which its value should be extracted.

Specified by:
loadValueFromSource in interface IParameter
CMException

setDataType

public void setDataType(int newDataType)
Sets the SQL data type of the parameter

Specified by:
setDataType in interface IParameter
Overrides:
setDataType in class AbstractParameter

setToken

public void setToken(String token)
              throws CMException
Sets the literal token that was used to denote this parameter in code

Specified by:
setToken in interface IParameter
Overrides:
setToken in class AbstractParameter
CMException

setValue

public void setValue(Object value)
              throws CMException
Sets the value of the parameter

Specified by:
setValue in interface IParameter
Overrides:
setValue in class AbstractParameter
CMException