public interface ExpressionResolver
An interface with a set of basic methods that are necessary for parsing string expressions.
-
Method Summary
Modifier and TypeMethodDescriptiondefault LiteralEvaluatorbuildExpression(LiteralExpression expression) Deprecated.default Collection<LiteralEvaluator>buildExpressions(Collection<LiteralExpression> expressions) Deprecated.in favor ofLiteralSourceCompilerresolve(String arg, NamedType.Resolver resolver) This method takes a string as an argument and builds aFieldReferenceif possible.default FieldReference[]resolve(NamedType.Resolver resolver, String... strings)
-
Method Details
-
resolve
This method takes a string as an argument and builds a
FieldReferenceif possible.For example, if the argument is "$c.category.id", the implementation might do the following:
- Parameters:
arg- a String to parseresolver- a mapping function between fact name and fullNamedType- Returns:
- returns
FieldReferenceinstance or throws anIllegalArgumentException - Throws:
IllegalArgumentException- if the argument can not be resolved
-
resolve
-
buildExpression
Deprecated.in favor ofLiteralSourceCompilerThis method parses a string argument and returns an
Evaluatorif possible.- Parameters:
expression- literal expression to compile- Returns:
- returns an
Evaluatorinstance or throws an exception - Throws:
IllegalArgumentException- if the expression can not be resolvedIllegalStateException- if the resolver is not in an appropriate state
-
buildExpressions
@Deprecated default Collection<LiteralEvaluator> buildExpressions(Collection<LiteralExpression> expressions) Deprecated.in favor ofLiteralSourceCompilerThis method builds literal expressions all at once and returns a collection of compiled results. Order is not guaranteed, use the
LiteralEvaluator.getSource()method to associate the resulting evaluators with the method's argument list.- Parameters:
expressions- literal expressions to compile- Returns:
- collection of
LiteralEvaluatorinstances - Throws:
IllegalArgumentException- if the expression can not be resolved
-
LiteralSourceCompiler