Class RuleEvaluator
java.lang.Object
software.amazon.smithy.rulesengine.language.evaluation.RuleEvaluator
- All Implemented Interfaces:
- ExpressionVisitor<Value>
A runtime implementation of a rule-set evaluation engine.
- 
Nested Class SummaryNested classes/interfaces inherited from interface software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitorExpressionVisitor.Default<R>
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic Valueevaluate(EndpointRuleSet ruleset, Map<Identifier, Value> parameterArguments) Initializes a newRuleEvaluatorinstances, and evaluates the provided ruleset and parameter arguments.evaluateCondition(Condition condition) Evaluates the given condition in the current scope.evaluateRuleSet(EndpointRuleSet ruleset, Map<Identifier, Value> parameterArguments) Evaluate the provided ruleset and parameter arguments.visitBoolEquals(Expression left, Expression right) Does a boolean equality check.visitGetAttr(GetAttr getAttr) Visits a GetAttr function.visitIsSet(Expression fn) Visits an isSet function.visitLibraryFunction(FunctionDefinition definition, List<Expression> arguments) Visits a library function.visitLiteral(Literal literal) Visits a literal.visitNot(Expression not) Visits a not function.Visits a reference.visitStringEquals(Expression left, Expression right) Does a string equality check.
- 
Constructor Details- 
RuleEvaluatorpublic RuleEvaluator()
 
- 
- 
Method Details- 
evaluateInitializes a newRuleEvaluatorinstances, and evaluates the provided ruleset and parameter arguments.- Parameters:
- ruleset- The endpoint ruleset.
- parameterArguments- The rule-set parameter identifiers and values to evaluate the rule-set against.
- Returns:
- The resulting value from the final matched rule.
 
- 
evaluateRuleSetEvaluate the provided ruleset and parameter arguments.- Parameters:
- ruleset- The endpoint ruleset.
- parameterArguments- The rule-set parameter identifiers and values to evaluate the rule-set against.
- Returns:
- The resulting value from the final matched rule.
 
- 
evaluateConditionEvaluates the given condition in the current scope.- Parameters:
- condition- the condition to evaluate.
- Returns:
- the value returned by the condition.
 
- 
visitLiteralDescription copied from interface:ExpressionVisitorVisits a literal.- Specified by:
- visitLiteralin interface- ExpressionVisitor<Value>
- Parameters:
- literal- the literal to visit.
- Returns:
- the value from the visitor.
 
- 
visitRefDescription copied from interface:ExpressionVisitorVisits a reference.- Specified by:
- visitRefin interface- ExpressionVisitor<Value>
- Parameters:
- reference- the reference to visit.
- Returns:
- the value from the visitor.
 
- 
visitIsSetDescription copied from interface:ExpressionVisitorVisits an isSet function.- Specified by:
- visitIsSetin interface- ExpressionVisitor<Value>
- Parameters:
- fn- the isSet function to visit.
- Returns:
- the value from the visitor.
 
- 
visitNotDescription copied from interface:ExpressionVisitorVisits a not function.- Specified by:
- visitNotin interface- ExpressionVisitor<Value>
- Parameters:
- not- the not function to visit.
- Returns:
- the value from the visitor.
 
- 
visitBoolEqualsDescription copied from interface:ExpressionVisitorDoes a boolean equality check.- Specified by:
- visitBoolEqualsin interface- ExpressionVisitor<Value>
- Parameters:
- left- the first value to compare.
- right- the second value to compare.
- Returns:
- the value from the visitor.
 
- 
visitStringEqualsDescription copied from interface:ExpressionVisitorDoes a string equality check.- Specified by:
- visitStringEqualsin interface- ExpressionVisitor<Value>
- Parameters:
- left- the first value to compare.
- right- the second value to compare.
- Returns:
- the value from the visitor.
 
- 
visitGetAttrDescription copied from interface:ExpressionVisitorVisits a GetAttr function.- Specified by:
- visitGetAttrin interface- ExpressionVisitor<Value>
- Parameters:
- getAttr- the GetAttr function to visit.
- Returns:
- the value from the visitor.
 
- 
visitLibraryFunctionDescription copied from interface:ExpressionVisitorVisits a library function.- Specified by:
- visitLibraryFunctionin interface- ExpressionVisitor<Value>
- Parameters:
- definition- the library function to visit.
- arguments- the arguments to the function being visited.
- Returns:
- the value from the visitor.
 
 
-