public abstract class ViewFactorySupport extends Object implements ViewFactory
Constructor and Description |
---|
ViewFactorySupport() |
Modifier and Type | Method and Description |
---|---|
static void |
assertReturnsNonConstant(String viewName,
ExprNode expression,
int index)
Assert and throws an exception if the expression passed returns a non-constant value.
|
boolean |
canReuse(View view,
AgentInstanceContext agentInstanceContext)
Determines if the given view could be used instead of creating a new view,
requires the view factory to compare view type, parameters and other capabilities provided.
|
static Object |
evaluate(ExprEvaluator evaluator,
int expressionNumber,
String viewName,
StatementContext statementContext) |
static Object |
evaluateAssertNoProperties(String viewName,
ExprNode expression,
int index,
ExprEvaluatorContext exprEvaluatorContext) |
static int |
evaluateSizeParam(String viewName,
ExprEvaluator sizeEvaluator,
AgentInstanceContext context) |
static ExprNode[] |
validate(String viewName,
EventType eventType,
StatementContext statementContext,
List<ExprNode> expressions,
boolean allowConstantResult)
Validate the view parameter expressions and return the validated expression for later execution.
|
static ExprNode[] |
validate(String viewName,
StatementContext statementContext,
List<ExprNode> expressions) |
static Object |
validateAndEvaluate(String viewName,
StatementContext statementContext,
ExprNode expression)
Validate the view parameter expression and evaluate the expression returning the result object.
|
static Object |
validateAndEvaluateExpr(String viewName,
StatementContext statementContext,
ExprNode expression,
StreamTypeService streamTypeService,
int expressionNumber) |
static ExprNode |
validateExpr(String viewName,
StatementContext statementContext,
ExprNode expression,
StreamTypeService streamTypeService,
int expressionNumber) |
static void |
validateNoParameters(String viewName,
List<ExprNode> expressionParameters) |
static void |
validateNoProperties(String viewName,
ExprNode expression,
int index) |
static ExprEvaluator |
validateSizeParam(String viewName,
StatementContext statementContext,
ExprNode sizeNode,
int expressionNumber) |
static ExprEvaluator |
validateSizeSingleParam(String viewName,
ViewFactoryContext viewFactoryContext,
List<ExprNode> expressionParameters) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
attach, getEventType, getViewName, makeView, setViewParameters
public boolean canReuse(View view, AgentInstanceContext agentInstanceContext)
ViewFactory
canReuse
in interface ViewFactory
view
- is the candidate view to compare toagentInstanceContext
- agent instance contextpublic static Object validateAndEvaluate(String viewName, StatementContext statementContext, ExprNode expression) throws ViewParameterException
viewName
- textual name of viewstatementContext
- context with statement servicesexpression
- view expression parameter to validateViewParameterException
- if the expressions fail to validatepublic static ExprNode[] validate(String viewName, StatementContext statementContext, List<ExprNode> expressions) throws ViewParameterException
ViewParameterException
public static ExprNode[] validate(String viewName, EventType eventType, StatementContext statementContext, List<ExprNode> expressions, boolean allowConstantResult) throws ViewParameterException
Does not evaluate the expression.
viewName
- textual name of vieweventType
- is the event type of the parent view or stream attached.statementContext
- context with statement servicesexpressions
- 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 invalidViewParameterException
- if the expressions fail to validatepublic static void assertReturnsNonConstant(String viewName, ExprNode expression, int index) throws ViewParameterException
viewName
- textual name of viewexpression
- expression to checkindex
- number offset of expression in view parametersViewParameterException
- if assertion failspublic static Object evaluateAssertNoProperties(String viewName, ExprNode expression, int index, ExprEvaluatorContext exprEvaluatorContext) throws ViewParameterException
ViewParameterException
public static void validateNoProperties(String viewName, ExprNode expression, int index) throws ViewParameterException
ViewParameterException
public static Object validateAndEvaluateExpr(String viewName, StatementContext statementContext, ExprNode expression, StreamTypeService streamTypeService, int expressionNumber) throws ViewParameterException
ViewParameterException
public static Object evaluate(ExprEvaluator evaluator, int expressionNumber, String viewName, StatementContext statementContext) throws ViewParameterException
ViewParameterException
public static ExprNode validateExpr(String viewName, StatementContext statementContext, ExprNode expression, StreamTypeService streamTypeService, int expressionNumber) throws ViewParameterException
ViewParameterException
public static ExprEvaluator validateSizeSingleParam(String viewName, ViewFactoryContext viewFactoryContext, List<ExprNode> expressionParameters) throws ViewParameterException
ViewParameterException
public static ExprEvaluator validateSizeParam(String viewName, StatementContext statementContext, ExprNode sizeNode, int expressionNumber) throws ViewParameterException
ViewParameterException
public static int evaluateSizeParam(String viewName, ExprEvaluator sizeEvaluator, AgentInstanceContext context)
public static void validateNoParameters(String viewName, List<ExprNode> expressionParameters) throws ViewParameterException
ViewParameterException