org.eclipse.datatools.connectivity.oda.spec.util
Class ExpressionFactory

java.lang.Object
  extended by org.eclipse.datatools.connectivity.oda.spec.util.ExpressionFactory

public class ExpressionFactory
extends java.lang.Object

Factory of expression instances for use in a QuerySpecification.
Provides convenient methods to create expression instances.

Since:
3.3 (DTP 1.8)

Constructor Summary
ExpressionFactory()
           
 
Method Summary
static CustomAggregate createCustomAggregate(java.lang.String extensionId, java.lang.String exprId)
          Creates a custom aggregate expression instance of the specified aggregate expression contributed by the specified dynamicResultSet extension.
static CustomAggregate createCustomAggregate(java.lang.String extensionId, java.lang.String exprId, ExpressionVariable variable)
          Creates a custom aggregate expression instance, with the given expression variable, of the specified aggregate expression contributed by the specified dynamicResultSet extension.
static CustomExpression createCustomExpression(java.lang.String extensionId, java.lang.String exprId)
          Creates a custom filter expression instance of the specified filter expression contributed by the specified dynamicResultSet extension.
static CustomExpression createCustomExpression(java.lang.String extensionId, java.lang.String exprId, ExpressionVariable variable, ExpressionArguments args)
          Creates a custom filter expression instance, with the given expression context, of the specified filter expression contributed by the specified dynamicResultSet extension.
static CustomFunction createCustomFunction(java.lang.String extensionId, java.lang.String functionId)
          Creates a custom function value expression instance of the specified function type contributed by the specified dynamicResultSet extension.
static CombinedValueExpressionOperator getCombinedOperator(java.lang.String extensionId, java.lang.String operatorId)
          Obtains the instance of the specified combined operator type, as supported or contributed by the specified dynamicResultSet extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExpressionFactory

public ExpressionFactory()
Method Detail

createCustomExpression

public static CustomExpression createCustomExpression(java.lang.String extensionId,
                                                      java.lang.String exprId)
                                               throws java.lang.IllegalArgumentException,
                                                      OdaException
Creates a custom filter expression instance of the specified filter expression contributed by the specified dynamicResultSet extension. The custom filter expression may be applied as part of an ODA filter specification.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
exprId - id of a custom filter expression
Returns:
an instance of CustomExpression or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or expression are not valid
OdaException

createCustomExpression

public static CustomExpression createCustomExpression(java.lang.String extensionId,
                                                      java.lang.String exprId,
                                                      ExpressionVariable variable,
                                                      ExpressionArguments args)
                                               throws java.lang.IllegalArgumentException,
                                                      OdaException
Creates a custom filter expression instance, with the given expression context, of the specified filter expression contributed by the specified dynamicResultSet extension. The custom filter expression may be applied as part of an ODA filter specification.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
exprId - id of a custom filter expression
variable - the expression variable to set on the created instance; may be null
args - the expression arguments to set on the created instance; may be null
Returns:
an instance of CustomExpression or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or expression are not valid
OdaException

createCustomAggregate

public static CustomAggregate createCustomAggregate(java.lang.String extensionId,
                                                    java.lang.String exprId)
                                             throws java.lang.IllegalArgumentException,
                                                    OdaException
Creates a custom aggregate expression instance of the specified aggregate expression contributed by the specified dynamicResultSet extension. The custom aggregate expression may be applied in an ODA ResultProjection specification.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
exprId - id of a custom filter expression
Returns:
an instance of CustomAggregate or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or expression are not valid
OdaException

createCustomAggregate

public static CustomAggregate createCustomAggregate(java.lang.String extensionId,
                                                    java.lang.String exprId,
                                                    ExpressionVariable variable)
                                             throws java.lang.IllegalArgumentException,
                                                    OdaException
Creates a custom aggregate expression instance, with the given expression variable, of the specified aggregate expression contributed by the specified dynamicResultSet extension. The custom aggregate expression may be applied in an ODA ResultProjection specification.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
exprId - id of a custom filter expression
variable - the input source variable to set on the created instance; may be null
Returns:
an instance of CustomAggregate or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or expression are not valid
OdaException

getCombinedOperator

public static CombinedValueExpressionOperator getCombinedOperator(java.lang.String extensionId,
                                                                  java.lang.String operatorId)
                                                           throws java.lang.IllegalArgumentException,
                                                                  OdaException
Obtains the instance of the specified combined operator type, as supported or contributed by the specified dynamicResultSet extension. A dynamicResultSet extension may override a built-in operator type, whose custom implementation would be returned. The returned operator instance may be applied to combine value expressions in an ODA CombinedValueExpression.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
operatorId - the id of a value expression combined operator type
Returns:
an instance of ValueExpressionCombinedOperator or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or operator are not valid
OdaException

createCustomFunction

public static CustomFunction createCustomFunction(java.lang.String extensionId,
                                                  java.lang.String functionId)
                                           throws java.lang.IllegalArgumentException,
                                                  OdaException
Creates a custom function value expression instance of the specified function type contributed by the specified dynamicResultSet extension. Caller may use the returned instance as a value expression, and assign function arguments to it as appropriate.

Parameters:
extensionId - unique id of an extension that implements the dynamicResultSet extension point
functionId - id of a custom function expression type
Returns:
an instance of CustomFunction or its subclass contributed by the specified dynamicResultSet extension
Throws:
java.lang.IllegalArgumentException - if the specified extension and/or function ids are not valid
OdaException