public class AssertExpression extends ExpressionOperation implements ValueAssertion<ScriptOperation.Context>
Tuple
values. Any Tuple that
returns true for the given expression pass the assertion. This Assertion
is based on the Janino compiler.
Specifically this filter uses the ExpressionEvaluator
, thus the syntax from that class is inherited here.
An expression may use field names directly as parameters in the expression, or field positions with the syntax
"$n", where n is an integer.
Given an argument tuple with the fields "a" and "b", the following expression returns true: a + b == $0 + $1
ScriptOperation.Context
block, parameterNames, parameterTypes, returnType
fieldDeclaration, numArgs, trace
Constructor and Description |
---|
AssertExpression(Fields fieldDeclaration,
String expression,
String[] parameterNames,
Class[] parameterTypes)
Constructor AssertExpression creates a new AssertExpression instance.
|
AssertExpression(String expression,
Class parameterType)
Constructor ExpressionFilter creates a new ExpressionFilter instance.
|
Modifier and Type | Method and Description |
---|---|
void |
doAssert(FlowProcess flowProcess,
ValueAssertionCall<ScriptOperation.Context> assertionCall)
Method doAssert performs the assertion.
|
boolean |
supportsPlannerLevel(PlannerLevel plannerLevel) |
getEvaluator, getExpression, guessParameterNames
equals, evaluate, getBlock, getParameterNames, getParameterTypes, getReturnType, hashCode, prepare
cleanup, flush, getFieldDeclaration, getNumArgs, getTrace, isSafe, printOperationInternal, toString, toStringInternal
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
cleanup, flush, getFieldDeclaration, getNumArgs, isSafe, prepare
@ConstructorProperties(value={"expression","parameterType"}) public AssertExpression(String expression, Class parameterType)
expression
- of type StringparameterType
- of type Class@ConstructorProperties(value={"fieldDeclaration","expression","parameterNames","parameterTypes"}) public AssertExpression(Fields fieldDeclaration, String expression, String[] parameterNames, Class[] parameterTypes)
fieldDeclaration
- of type Fieldsexpression
- of type StringparameterNames
- of type String[]parameterTypes
- of type Class[]public boolean supportsPlannerLevel(PlannerLevel plannerLevel)
supportsPlannerLevel
in interface PlannedOperation<ScriptOperation.Context>
public void doAssert(FlowProcess flowProcess, ValueAssertionCall<ScriptOperation.Context> assertionCall)
ValueAssertion
doAssert
in interface ValueAssertion<ScriptOperation.Context>
flowProcess
- of type FlowProcessassertionCall
- of type ValueAssertionCallCopyright © 2007-2015 Concurrent, Inc. All Rights Reserved.