Class TraversingVisitor<R>
- java.lang.Object
-
- software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor.Default<java.util.stream.Stream<R>>
-
- software.amazon.smithy.rulesengine.language.TraversingVisitor<R>
-
- Type Parameters:
R
- the return type.
- All Implemented Interfaces:
ExpressionVisitor<java.util.stream.Stream<R>>
,RuleValueVisitor<java.util.stream.Stream<R>>
public class TraversingVisitor<R> extends ExpressionVisitor.Default<java.util.stream.Stream<R>> implements RuleValueVisitor<java.util.stream.Stream<R>>
A visitor for traversing the rules and conditions of a rule-set.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor
ExpressionVisitor.Default<R>
-
-
Constructor Summary
Constructors Constructor Description TraversingVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.stream.Stream<R>
getDefault()
java.util.stream.Stream<R>
visitConditions(java.util.List<Condition> conditions)
Endpoint
visitor method.java.util.stream.Stream<R>
visitEndpoint(Endpoint endpoint)
Endpoint
visitor method.java.util.stream.Stream<R>
visitEndpointRule(Endpoint endpoint)
Invoked when reaching an endpoint rule.java.util.stream.Stream<R>
visitErrorRule(Expression error)
Invoked when reaching an error rule.java.util.stream.Stream<R>
visitRuleset(EndpointRuleSet ruleset)
Given anEndpointRuleSet
will invoke the visitor methods for each rule.java.util.stream.Stream<R>
visitTreeRule(java.util.List<Rule> rules)
Invoked when reaching a tree rule.-
Methods inherited from class software.amazon.smithy.rulesengine.language.syntax.expressions.ExpressionVisitor.Default
visitBoolEquals, visitGetAttr, visitIsSet, visitLibraryFunction, visitLiteral, visitNot, visitRef, visitStringEquals
-
-
-
-
Method Detail
-
visitRuleset
public java.util.stream.Stream<R> visitRuleset(EndpointRuleSet ruleset)
Given anEndpointRuleSet
will invoke the visitor methods for each rule.- Parameters:
ruleset
- the endpoint rule-set to traverse.- Returns:
- a stream of values.
-
getDefault
public java.util.stream.Stream<R> getDefault()
- Specified by:
getDefault
in classExpressionVisitor.Default<java.util.stream.Stream<R>>
-
visitTreeRule
public java.util.stream.Stream<R> visitTreeRule(java.util.List<Rule> rules)
Description copied from interface:RuleValueVisitor
Invoked when reaching a tree rule.- Specified by:
visitTreeRule
in interfaceRuleValueVisitor<R>
- Parameters:
rules
- the sub-rules within a tree rule.- Returns:
- the visitor return type.
-
visitErrorRule
public java.util.stream.Stream<R> visitErrorRule(Expression error)
Description copied from interface:RuleValueVisitor
Invoked when reaching an error rule.- Specified by:
visitErrorRule
in interfaceRuleValueVisitor<R>
- Parameters:
error
- the error expression for the rule.- Returns:
- the visitor return type.
-
visitEndpointRule
public java.util.stream.Stream<R> visitEndpointRule(Endpoint endpoint)
Description copied from interface:RuleValueVisitor
Invoked when reaching an endpoint rule.- Specified by:
visitEndpointRule
in interfaceRuleValueVisitor<R>
- Parameters:
endpoint
- the endpoint of the rule.- Returns:
- the visitor return type.
-
visitEndpoint
public java.util.stream.Stream<R> visitEndpoint(Endpoint endpoint)
Endpoint
visitor method.- Parameters:
endpoint
- the endpoint to visit.- Returns:
- a stream of values.
-
-