Class RuleElementVisitor<TContext>
Visitor to traverse or rewrite rule definition (or its part).
public class RuleElementVisitor<TContext>
Type Parameters
TContext
Traversal context.
- Inheritance
-
RuleElementVisitor<TContext>
- Inherited Members
Methods
Visit(TContext, IRuleDefinition)
Visits a rule definition and all its nodes.
public IRuleDefinition Visit(TContext context, IRuleDefinition rule)
Parameters
context
TContextTraversal context.
rule
IRuleDefinitionRule definition.
Returns
- IRuleDefinition
The original or a new rewritten rule definition.
Visit(TContext, RuleElement?)
Visits a rule element and all its descendant nodes.
public RuleElement? Visit(TContext context, RuleElement? element)
Parameters
context
TContextTraversal context.
element
RuleElementRule element.
Returns
- RuleElement
The original or a new rewritten rule element.
VisitAction(TContext, ActionElement)
protected virtual ActionElement VisitAction(TContext context, ActionElement element)
Parameters
context
TContextelement
ActionElement
Returns
VisitActionGroup(TContext, ActionGroupElement)
protected virtual ActionGroupElement VisitActionGroup(TContext context, ActionGroupElement element)
Parameters
context
TContextelement
ActionGroupElement
Returns
VisitAggregate(TContext, AggregateElement)
protected virtual RuleElement VisitAggregate(TContext context, AggregateElement element)
Parameters
context
TContextelement
AggregateElement
Returns
VisitAnd(TContext, AndElement)
protected virtual RuleElement VisitAnd(TContext context, AndElement element)
Parameters
context
TContextelement
AndElement
Returns
VisitBinding(TContext, BindingElement)
protected virtual RuleElement VisitBinding(TContext context, BindingElement element)
Parameters
context
TContextelement
BindingElement
Returns
VisitDependency(TContext, DependencyElement)
protected virtual DependencyElement VisitDependency(TContext context, DependencyElement element)
Parameters
context
TContextelement
DependencyElement
Returns
VisitDependencyGroup(TContext, DependencyGroupElement)
protected virtual DependencyGroupElement VisitDependencyGroup(TContext context, DependencyGroupElement element)
Parameters
context
TContextelement
DependencyGroupElement
Returns
VisitExists(TContext, ExistsElement)
protected virtual RuleElement VisitExists(TContext context, ExistsElement element)
Parameters
context
TContextelement
ExistsElement
Returns
VisitFilter(TContext, FilterElement)
protected virtual FilterElement VisitFilter(TContext context, FilterElement element)
Parameters
context
TContextelement
FilterElement
Returns
VisitFilterGroup(TContext, FilterGroupElement)
protected virtual FilterGroupElement VisitFilterGroup(TContext context, FilterGroupElement element)
Parameters
context
TContextelement
FilterGroupElement
Returns
VisitForAll(TContext, ForAllElement)
protected virtual RuleElement VisitForAll(TContext context, ForAllElement element)
Parameters
context
TContextelement
ForAllElement
Returns
VisitNamedExpression(TContext, NamedExpressionElement)
protected virtual NamedExpressionElement VisitNamedExpression(TContext context, NamedExpressionElement element)
Parameters
context
TContextelement
NamedExpressionElement
Returns
VisitNot(TContext, NotElement)
protected virtual RuleElement VisitNot(TContext context, NotElement element)
Parameters
context
TContextelement
NotElement
Returns
VisitOr(TContext, OrElement)
protected virtual RuleElement VisitOr(TContext context, OrElement element)
Parameters
context
TContextelement
OrElement
Returns
VisitPattern(TContext, PatternElement)
protected virtual PatternElement VisitPattern(TContext context, PatternElement element)
Parameters
context
TContextelement
PatternElement
Returns
Visit<T>(TContext, IReadOnlyList<T>, Func<TContext, T, T>)
Visits each element in the collection and all their descendant nodes. If any of the elements is rewritten, a new collection is returned.
public static IReadOnlyList<T> Visit<T>(TContext context, IReadOnlyList<T> elements, Func<TContext, T, T> visitFunc) where T : RuleElement
Parameters
context
TContextTraversal context.
elements
IReadOnlyList<T>Collection of rule elements to visit.
visitFunc
Func<TContext, T, T>Concrete visitor delegate.
Returns
- IReadOnlyList<T>
The original or a new rewritten collection of rule elements.
Type Parameters
T
Type of rule elements to visit.