Class AbstractVisitorRule

    • Constructor Detail

      • AbstractVisitorRule

        public AbstractVisitorRule()
    • Method Detail

      • apply

        public void apply​(Node target,
                          RuleContext ctx)
        Description copied from interface: Rule
        Process the given node. The nodes that are fed to this method are the nodes selected by Rule.getTargetSelector().
        Parameters:
        target - Node on which to apply the rule
        ctx - Rule context, handling violations
      • buildVisitor

        public abstract AstVisitor<RuleContext,​?> buildVisitor()
        Returns a rule visitor that can visit nodes for the given rule context. This visitor should explore the nodes it's interested in and report violations on the given rule context.

        Language specific subclasses should redefine the return type to use a language specific visitor interface.

        Returns:
        A visitor bound to the given rule context