public class Expressions extends Object
| Constructor and Description |
|---|
Expressions(org.antlr.v4.runtime.tree.ParseTree aTree,
String anExpression) |
| Modifier and Type | Method and Description |
|---|---|
com.fasterxml.jackson.databind.JsonNode |
evaluate(com.fasterxml.jackson.databind.JsonNode rootContext)
Evaluate the stored expression against the supplied event and application
interface data.
|
com.fasterxml.jackson.databind.JsonNode |
evaluate(com.fasterxml.jackson.databind.JsonNode rootContext,
long timeoutMS,
int maxDepth)
Evaluate the stored expression against the supplied event and application
interface data.
|
ExpressionsVisitor |
getExpr() |
static List<String> |
getRefsInExpression(Pattern refPattern,
String expression)
Returns a list of $something references in the given expression, using the
given Pattern object (typically patterns should match on $state or $event)
|
org.antlr.v4.runtime.tree.ParseTree |
getTree() |
static Expressions |
parse(String mappingExpression) |
void |
setExpr(ExpressionsVisitor expr) |
void |
setTree(org.antlr.v4.runtime.tree.ParseTree parsetree) |
void |
timeboxExpression(long timeoutMS,
int maxDepth) |
String |
toString() |
public Expressions(org.antlr.v4.runtime.tree.ParseTree aTree,
String anExpression)
public static List<String> getRefsInExpression(Pattern refPattern, String expression)
refPattern - reference patternexpression - expression to be searched for referencespublic static Expressions parse(String mappingExpression) throws ParseException, IOException
ParseExceptionIOExceptionpublic com.fasterxml.jackson.databind.JsonNode evaluate(com.fasterxml.jackson.databind.JsonNode rootContext,
long timeoutMS,
int maxDepth)
throws EvaluateException
rootContext - bound to root context ($$ and paths that don't start with
$event, $state or $instance) when evaluating expressions.
May be null.timeoutMS - milliseconds allowed for the evaluation to occur. If it takes longer
an exception is thrown. Must be positive number or exception is thrown.maxDepth - the maximum call stack depth allowed before an exception is thrown. Must
be a positive number or an exception is thrown.EvaluateException - If the given device event is invalid.public com.fasterxml.jackson.databind.JsonNode evaluate(com.fasterxml.jackson.databind.JsonNode rootContext)
throws EvaluateException
rootContext - bound to root context ($$ and paths that don't start with
$event, $state or $instance) when evaluating expressions.
May be null.EvaluateException - If the given device event is invalid.public ExpressionsVisitor getExpr()
public void setExpr(ExpressionsVisitor expr)
public org.antlr.v4.runtime.tree.ParseTree getTree()
public void setTree(org.antlr.v4.runtime.tree.ParseTree parsetree)
public void timeboxExpression(long timeoutMS,
int maxDepth)
Copyright © 2020. All rights reserved.