Package org.evrete.api
Interface ExpressionResolver
public interface ExpressionResolver
An interface with a set of basic methods that are necessary for parsing string expressions.
-
Method Summary
Modifier and TypeMethodDescriptionbuildExpression(String expression, NamedType.Resolver resolver) This method parses a string argument and returns anEvaluatorif possible.resolve(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
Evaluator buildExpression(String expression, NamedType.Resolver resolver) throws CompilationException This method parses a string argument and returns an
Evaluatorif possible.- Parameters:
expression- - a String condition expression to parseresolver- a mapping function between fact name andNamedType- Returns:
- returns an
Evaluatorinstance or throws an exception - Throws:
CompilationException- if the argument can not be compiledIllegalArgumentException- if the expression can not be resolved- See Also:
-