|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface ExpressionFactory
This interface provides methods for factorizing expression nodes. Expression nodes are used as filter expressions for query trees.
| Method Summary | |
|---|---|
AndExpression |
newAnd(Expression left,
Expression right)
Returns an and expression for the arguments left and right. |
CastExpression |
newCast(java.lang.Class clazz,
Expression expression)
Returns an instance of CastExpression. |
ComplementExpression |
newComplement(Expression expr)
Returns a complement expression for the argument expr. |
ConditionalAndExpression |
newConditionalAnd(Expression left,
Expression right)
Returns a conditional and expression for the arguments left and right. |
ConditionalOrExpression |
newConditionalOr(Expression left,
Expression right)
Returns a conditional or expression for the arguments left and right. |
ConstantExpression |
newConstant(boolean b)
Returns an instance of BooleanLiteralExpression. |
ConstantExpression |
newConstant(byte b)
Returns an instance of ByteLiteralExpression. |
ConstantExpression |
newConstant(char c)
Returns an instance of CharLiteralExpression. |
ConstantExpression |
newConstant(double d)
Returns an instance of DoubleLiteralExpression. |
ConstantExpression |
newConstant(float f)
Returns an instance of FloatLiteralExpression. |
ConstantExpression |
newConstant(int i)
Returns an instance of IntLiteralExpression. |
ConstantExpression |
newConstant(long l)
Returns an instance of LongLiteralExpression. |
ConstantExpression |
newConstant(java.lang.Object value)
Returns an instance of ConstantExpression. |
ConstantExpression |
newConstant(short s)
Returns an instance of ShortLiteralExpression. |
DivideExpression |
newDivide(Expression left,
Expression right)
Returns a divide expression for the arguments left and right. |
EqualsExpression |
newEquals(Expression left,
Expression right)
Returns an equals expression for the arguments left and right. |
StaticFieldAccessExpression |
newFieldAccess(java.lang.Class clazz,
java.lang.String fieldName)
Returns an instance of StaticFieldAccessExpression. |
FieldAccessExpression |
newFieldAccess(Expression target,
java.lang.String fieldName)
Returns an instance of FieldAccessExpression. |
GreaterThanExpression |
newGreaterThan(Expression left,
Expression right)
Returns a greater than expression for the arguments left and right. |
GreaterThanEqualsExpression |
newGreaterThanEquals(Expression left,
Expression right)
Returns a greater than equals expression for the arguments left and right. |
IdentifierExpression |
newIdentifier(java.lang.String identifier)
The implementation may decide to create an instance of FieldAccessExpression,
VariableAccessExpression or
ParameterAccessExpression depending on the fact
whether the argument corresponds with a parameter, variable or
a field of the candidate class. |
LessThanExpression |
newLessThan(Expression left,
Expression right)
Returns a less than expression for the arguments left and right. |
LessThanEqualsExpression |
newLessThanEquals(Expression left,
Expression right)
Returns a less than equals expression for the arguments left and right. |
MethodCallExpression |
newMethodCall(Expression target,
java.lang.String methodName,
Expression[] arguments)
The implementation may decide to create a specialized instance of MethodCallExpression (for example,
ContainsCallExpression)
depending on the argument methodName. |
UnaryMinusExpression |
newMinus(Expression expr)
Returns a unary minus expression for the argument expr. |
MinusExpression |
newMinus(Expression left,
Expression right)
Returns a minus expression for the arguments left and right. |
NotExpression |
newNot(Expression expr)
Returns a not expression for the argument expr. |
NotEqualsExpression |
newNotEquals(Expression left,
Expression right)
Returns a not equals expression for the arguments left and right. |
OrExpression |
newOr(Expression left,
Expression right)
Returns an or expression for the arguments left and right. |
UnaryPlusExpression |
newPlus(Expression expr)
Returns a plus expression for the argument expr. |
PlusExpression |
newPlus(Expression left,
Expression right)
Returns a plus expression for the arguments left and right. |
TimesExpression |
newTimes(Expression left,
Expression right)
Returns a times expression for the arguments left and right. |
| Method Detail |
|---|
IdentifierExpression newIdentifier(java.lang.String identifier)
FieldAccessExpression,
VariableAccessExpression or
ParameterAccessExpression depending on the fact
whether the argument corresponds with a parameter, variable or
a field of the candidate class. Optionally, the implementation
may return an instance of IdentifierExpression
which later may be replaced with its specialized counterpart
semantically analysing a query tree.
identifier - the name of the identifier access expression
FieldAccessExpression newFieldAccess(Expression target,
java.lang.String fieldName)
FieldAccessExpression.
target - the target expression of the field access expressionfieldName - the name of the field to access
StaticFieldAccessExpression newFieldAccess(java.lang.Class clazz,
java.lang.String fieldName)
StaticFieldAccessExpression.
clazz - the class instance defining the fieldfieldName - the name of the field to access
MethodCallExpression newMethodCall(Expression target,
java.lang.String methodName,
Expression[] arguments)
MethodCallExpression (for example,
ContainsCallExpression)
depending on the argument methodName.
Optionally, the implementation may return an instance of
MethodCallExpression
which later may be replaced with its specialized counterpart
semantically analysing a query tree.
target - the target expression of the method call expressionmethodName - the name of the methodarguments - the array of arguments
CastExpression newCast(java.lang.Class clazz,
Expression expression)
CastExpression.
clazz - the Java class to cast the argument
expression toexpression - the expression to cast
ConstantExpression newConstant(boolean b)
BooleanLiteralExpression.
b - the value wrapped by the boolean expression
ConstantExpression newConstant(byte b)
ByteLiteralExpression.
b - the value wrapped by the byte expression
ConstantExpression newConstant(char c)
CharLiteralExpression.
c - the value wrapped by the char expression
ConstantExpression newConstant(double d)
DoubleLiteralExpression.
d - the value wrapped by the double expression
ConstantExpression newConstant(float f)
FloatLiteralExpression.
f - the value wrapped by the float expression
ConstantExpression newConstant(int i)
IntLiteralExpression.
i - the value wrapped by the int expression
ConstantExpression newConstant(long l)
LongLiteralExpression.
l - the value wrapped by the long expression
ConstantExpression newConstant(short s)
ShortLiteralExpression.
s - the value wrapped by the short expression
ConstantExpression newConstant(java.lang.Object value)
ConstantExpression.
This method handles null as a constant expression.
value - the object wrapped by the constant expression
ComplementExpression newComplement(Expression expr)
expr.
expr - the expression argument for the operation
UnaryMinusExpression newMinus(Expression expr)
expr.
expr - the expression argument for the operation
NotExpression newNot(Expression expr)
expr.
expr - the expression argument for the operation
UnaryPlusExpression newPlus(Expression expr)
expr.
expr - the expression argument for the operation
AndExpression newAnd(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
ConditionalAndExpression newConditionalAnd(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
ConditionalOrExpression newConditionalOr(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
DivideExpression newDivide(Expression left,
Expression right)
left and right.
This method throws NullPointerException if one of
the arguments left or right are
null.
left - the left expression argument for the operationright - the right expression argument for the operation
EqualsExpression newEquals(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
GreaterThanExpression newGreaterThan(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
GreaterThanEqualsExpression newGreaterThanEquals(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
LessThanExpression newLessThan(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
LessThanEqualsExpression newLessThanEquals(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
MinusExpression newMinus(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
NotEqualsExpression newNotEquals(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
PlusExpression newPlus(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
OrExpression newOr(Expression left,
Expression right)
left and right.
This method throws NullPointerException if one of
the arguments left or right are
null.
left - the left expression argument for the operationright - the right expression argument for the operation
TimesExpression newTimes(Expression left,
Expression right)
left and right.
left - the left expression argument for the operationright - the right expression argument for the operation
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||