Package org.evrete.api
Interface ExpressionResolver
-
public interface ExpressionResolverAn interface with a set of basic methods that are necessary for parsing string expressions.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default LiteralEvaluatorbuildExpression(LiteralExpression ignored)Deprecated.in favor ofLiteralSourceCompilerdefault Collection<LiteralEvaluator>buildExpressions(Collection<LiteralExpression> ignored)Deprecated.in favor ofLiteralSourceCompilerFieldReferenceresolve(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 Detail
-
resolve
FieldReference resolve(String arg, NamedType.Resolver resolver)
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
default FieldReference[] resolve(NamedType.Resolver resolver, String... strings)
-
buildExpression
default LiteralEvaluator buildExpression(LiteralExpression ignored)
Deprecated.in favor ofLiteralSourceCompilerThis method parses a string argument and returns an
Evaluatorif possible.- 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> ignored)
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.- Returns:
- collection of
LiteralEvaluatorinstances - Throws:
IllegalArgumentException- if the expression can not be resolved
-
-