public class CollectionExpressionEvaluator extends java.lang.Object implements ExpressionEvaluator
ExpressionEvaluator for Collection type as well as it's collection elements.
It must be configured in which mode to operate with setElementMode(boolean) or
setCollectionMode(boolean). This is necessary to avoid operator clashes. (e.g. isEmpty operator can be
applied on elements as well as on collection itself) Depending on current operation mode the result of
getSupportedRightTypes(String) or getSupportedOperators() differs.| Constructor and Description |
|---|
CollectionExpressionEvaluator() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(java.lang.Object leftOperand,
java.lang.String operator,
java.lang.Object rightOperand)
Evaluates this expression.
|
ExpressionEvaluator |
getElementEvaluator()
Returns the
ExpressionEvaluator which is used for the elements of the collection. |
java.lang.Class |
getLeftType()
Returns the type which is expected for left operand.
|
java.util.Collection<java.lang.String> |
getSupportedOperators()
Returns a Collection of supported Operators.
|
java.util.Collection<java.lang.Class> |
getSupportedRightTypes(java.lang.String operator)
Returns a Collection of types which are supported as right Operand.
|
boolean |
isSupported(java.lang.Class leftType,
java.lang.String operator,
java.lang.Class rightType)
Returns true when type of left and right operand and the passed operator is supported.
|
void |
setCollectionExpEval(ExpressionEvaluator collectionExpEval) |
void |
setCollectionMode(boolean collectionMode)
Convenience method.
|
void |
setElementExpEval(ExpressionEvaluator elementExpEval) |
void |
setElementMode(boolean elementMode)
When true collection elements are getting evaluated rather then the collection itself.
|
public void setCollectionMode(boolean collectionMode)
setElementMode(boolean).collectionMode - public void setElementMode(boolean elementMode)
elementMode - true for evaluating collection elementspublic ExpressionEvaluator getElementEvaluator()
ExpressionEvaluator which is used for the elements of the collection.ExpressionEvaluatorpublic boolean evaluate(java.lang.Object leftOperand,
java.lang.String operator,
java.lang.Object rightOperand)
ExpressionEvaluatorExpressionEvaluationException is
thrown. Returns true when expression evaluates to true, returns false otherwise.evaluate in interface ExpressionEvaluatorleftOperand - value for left operandoperator - operatorrightOperand - value for right operandpublic java.lang.Class getLeftType()
ExpressionEvaluatorgetLeftType in interface ExpressionEvaluatorpublic java.util.Collection<java.lang.Class> getSupportedRightTypes(java.lang.String operator)
ExpressionEvaluatorgetSupportedRightTypes in interface ExpressionEvaluatoroperator - the operator which shall be appliedpublic java.util.Collection<java.lang.String> getSupportedOperators()
ExpressionEvaluatorgetSupportedOperators in interface ExpressionEvaluatorpublic boolean isSupported(java.lang.Class leftType,
java.lang.String operator,
java.lang.Class rightType)
ExpressionEvaluatorisSupported in interface ExpressionEvaluatorleftType - type of left operandoperator - the operatorrightType - type of right operandpublic void setElementExpEval(ExpressionEvaluator elementExpEval)
elementExpEval - the elementExpEval to setpublic void setCollectionExpEval(ExpressionEvaluator collectionExpEval)
collectionExpEval - the collectionExpEval to setCopyright © 2018 SAP SE. All Rights Reserved.