Class ViewForgeSupport
java.lang.Object
com.espertech.esper.common.internal.view.util.ViewForgeSupport
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
assertReturnsNonConstant
(String viewName, ExprNode expression, int index) Assert and throws an exception if the expression passed returns a non-constant value.static Object
evaluate
(ExprEvaluator evaluator, int expressionNumber, String viewName) static Object
evaluateAssertNoProperties
(String viewName, ExprNode expression, int index) static ExprNode[]
validate
(String viewName, EventType eventType, List<ExprNode> expressions, boolean allowConstantResult, ViewForgeEnv viewForgeEnv) Validate the view parameter expressions and return the validated expression for later execution.static ExprNode[]
validate
(String viewName, List<ExprNode> expressions, ViewForgeEnv viewForgeEnv, int streamNumber) static Object
validateAndEvaluate
(String viewName, ExprNode expression, ViewForgeEnv viewForgeEnv) static Object
validateAndEvaluateExpr
(String viewName, ExprNode expression, StreamTypeService streamTypeService, ViewForgeEnv viewForgeEnv, int expressionNumber) static ExprNode
validateExpr
(String viewName, ExprNode expression, StreamTypeService streamTypeService, ViewForgeEnv viewForgeEnv, int expressionNumber) static void
validateNoParameters
(String viewName, List<ExprNode> expressionParameters) static void
validateNoProperties
(String viewName, ExprNode expression, int index) static ExprForge
validateSizeParam
(String viewName, ExprNode sizeNode, int expressionNumber) static ExprForge
validateSizeSingleParam
(String viewName, List<ExprNode> expressionParameters, ViewForgeEnv viewForgeEnv, int streamNumber)
-
Constructor Details
-
ViewForgeSupport
public ViewForgeSupport()
-
-
Method Details
-
validateAndEvaluate
public static Object validateAndEvaluate(String viewName, ExprNode expression, ViewForgeEnv viewForgeEnv) throws ViewParameterException - Throws:
ViewParameterException
-
evaluateAssertNoProperties
public static Object evaluateAssertNoProperties(String viewName, ExprNode expression, int index) throws ViewParameterException - Throws:
ViewParameterException
-
assertReturnsNonConstant
public static void assertReturnsNonConstant(String viewName, ExprNode expression, int index) throws ViewParameterException Assert and throws an exception if the expression passed returns a non-constant value.- Parameters:
viewName
- textual name of viewexpression
- expression to checkindex
- number offset of expression in view parameters- Throws:
ViewParameterException
- if assertion fails
-
validateNoProperties
public static void validateNoProperties(String viewName, ExprNode expression, int index) throws ViewParameterException - Throws:
ViewParameterException
-
validateAndEvaluateExpr
public static Object validateAndEvaluateExpr(String viewName, ExprNode expression, StreamTypeService streamTypeService, ViewForgeEnv viewForgeEnv, int expressionNumber) throws ViewParameterException - Throws:
ViewParameterException
-
validateSizeSingleParam
public static ExprForge validateSizeSingleParam(String viewName, List<ExprNode> expressionParameters, ViewForgeEnv viewForgeEnv, int streamNumber) throws ViewParameterException - Throws:
ViewParameterException
-
validateSizeParam
public static ExprForge validateSizeParam(String viewName, ExprNode sizeNode, int expressionNumber) throws ViewParameterException - Throws:
ViewParameterException
-
validate
public static ExprNode[] validate(String viewName, EventType eventType, List<ExprNode> expressions, boolean allowConstantResult, ViewForgeEnv viewForgeEnv) throws ViewParameterException Validate the view parameter expressions and return the validated expression for later execution.Does not evaluate the expression.
- Parameters:
viewName
- textual name of vieweventType
- is the event type of the parent view or stream attached.expressions
- view expression parameter to validateallowConstantResult
- true to indicate whether expressions that return a constant result should be allowed; false to indicate that if an expression is known to return a constant result the expression is considered invalidviewForgeEnv
- view forge env- Returns:
- object result value of parameter expressions
- Throws:
ViewParameterException
- if the expressions fail to validate
-
validate
public static ExprNode[] validate(String viewName, List<ExprNode> expressions, ViewForgeEnv viewForgeEnv, int streamNumber) throws ViewParameterException - Throws:
ViewParameterException
-
validateExpr
public static ExprNode validateExpr(String viewName, ExprNode expression, StreamTypeService streamTypeService, ViewForgeEnv viewForgeEnv, int expressionNumber) throws ViewParameterException - Throws:
ViewParameterException
-
evaluate
public static Object evaluate(ExprEvaluator evaluator, int expressionNumber, String viewName) throws ViewParameterException - Throws:
ViewParameterException
-
validateNoParameters
public static void validateNoParameters(String viewName, List<ExprNode> expressionParameters) throws ViewParameterException - Throws:
ViewParameterException
-