Class MockRule

  • All Implemented Interfaces:
    PropertySource, Rule

    public class MockRule
    extends AbstractRule
    This is not a supported API. You need the pmd-test module on your classpath, or pmd-core's test sources. This will be removed in 7.0.0
    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.
    • Method Detail

      • apply

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