Class MockRule

  • All Implemented Interfaces:
    PropertySource, Rule

    public class MockRule
    extends AbstractRule
    This is a Rule implementation which can be used in scenarios where an actual functional Rule is not needed. For example, during unit testing, or as an editable surrogate used by IDE plugins. The Language of this Rule defaults to Java.
    • Constructor Detail

      • MockRule

        public MockRule()
      • MockRule

        public MockRule​(java.lang.String name,
                        java.lang.String description,
                        java.lang.String message,
                        java.lang.String ruleSetName,
                        RulePriority priority)
      • MockRule

        public MockRule​(java.lang.String name,
                        java.lang.String description,
                        java.lang.String message,
                        java.lang.String ruleSetName)
    • Method Detail

      • apply

        public void apply​(java.util.List<? extends Node> nodes,
                          RuleContext ctx)
        Description copied from interface: Rule
        Apply this rule to the given collection of nodes, using the given context.
        Parameters:
        nodes - the nodes
        ctx - the rule context