org.eclipse.datatools.connectivity.oda.spec
Class ValueExpression

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.spec.ValueExpression
Direct Known Subclasses:
AtomicValueExpression, CombinedValueExpression, NestedValueExpression

public abstract class ValueExpression
extends java.lang.Object

The abstract base class for an ODA expression that resolves to a value. It may be associated with an ExpressionVariable or ExpressionArguments in an ODA query specification.
It is the responsibility of an ODA driver to resolve an expression, when evaluating it with a query result spec expression. This may be extended to represent complex types of value expression.

Since:
3.3 (DTP 1.8)

Field Summary
static java.lang.Integer UNKNOWN_ODA_DATA_TYPE
           
 
Constructor Summary
ValueExpression()
           
 
Method Summary
 java.lang.String getName()
          Gets the name of this value expression type.
 java.lang.Integer getOdaDataType()
          Gets the ODA-defined code value of this variable's data type.
 java.lang.String getQualifiedId()
          Returns the qualified id of this value expression type.
 ExpressionVariable.VariableType getVariableType()
          Returns the type of expression.
 void setOdaDataType(java.lang.Integer odaDataType)
          Sets the ODA data type of this variable.
 java.lang.String toString()
           
 void validate()
          Validates this value expression.
 void validate(ValidationContext context)
          Validates this expression in the specified context.
abstract  void validateSyntax(ValidationContext context)
          Performs syntactic validation of this expression in the specified context.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_ODA_DATA_TYPE

public static final java.lang.Integer UNKNOWN_ODA_DATA_TYPE
Constructor Detail

ValueExpression

public ValueExpression()
Method Detail

getQualifiedId

public java.lang.String getQualifiedId()
Returns the qualified id of this value expression type.

Returns:
qualified id

getName

public java.lang.String getName()
Gets the name of this value expression type. It may be used to identify this in user messages or logging.

Returns:
name of this value expression

getVariableType

public ExpressionVariable.VariableType getVariableType()
Returns the type of expression.

Returns:

getOdaDataType

public java.lang.Integer getOdaDataType()
Gets the ODA-defined code value of this variable's data type. This serves as an optional hint that may have been specified based on the resolved expression.

Returns:
the ODA data type code of this variable, or null if not available

setOdaDataType

public void setOdaDataType(java.lang.Integer odaDataType)
Sets the ODA data type of this variable. This serves as an optional hint that may have been specified based on the resolved expression, and may be ignored by the runtime driver, if appropriate.

Parameters:
odaDataTypeCode - the ODA data type code of this variable; may be null to unset current value

validate

public void validate()
              throws OdaException
Validates this value expression.

Throws:
OdaException - if validation failed. The concrete cause is defined by the subclass implementing this method.

validate

public void validate(ValidationContext context)
              throws OdaException
Validates this expression in the specified context.

Parameters:
context - context for validation; may be null which would limit the scope of validation
Throws:
OdaException - if validation failed. The concrete cause is defined by the subclass implementing this method.

validateSyntax

public abstract void validateSyntax(ValidationContext context)
                             throws OdaException
Performs syntactic validation of this expression in the specified context.

Parameters:
context - context for validation; may be null which would limit the scope of validation
Throws:
OdaException - if validation failed. The concrete cause is defined by the subclass implementing this method.

toString

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