net.sourceforge.pmd.lang.rule

## Class MockRule

- java.lang.Object
- - net.sourceforge.pmd.AbstractPropertySource
  - - net.sourceforge.pmd.lang.rule.AbstractRule
    - - net.sourceforge.pmd.lang.rule.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.

### Field Summary

### Fields inherited from class net.sourceforge.pmd.AbstractPropertySource

`propertyDescriptors, propertyValuesByDescriptor`

### Fields inherited from interface net.sourceforge.pmd.Rule

`VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR`

### Constructor Summary

Constructors
Constructor and Description
`MockRule()`
`MockRule(String name, String description, String message, String ruleSetName)`
`MockRule(String name, String description, String message, String ruleSetName, RulePriority priority)`

### Method Summary

Methods
`void` `apply(List<? extends Node> nodes, RuleContext ctx)` Apply this rule to the given collection of nodes, using the given context.

### Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule

`addExample, addRuleChainVisit, addRuleChainVisit, addViolation, addViolation, addViolation, addViolationWithMessage, addViolationWithMessage, addViolationWithMessage, deepCopyValuesTo, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getParserOptions, getPriority, getRuleChainVisits, getRuleClass, getRuleSetName, getSince, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, setUsesDFA, setUsesTypeResolution, start, usesDFA, usesRuleChain, usesTypeResolution`

### Methods inherited from class net.sourceforge.pmd.AbstractPropertySource

`copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Methods inherited from interface net.sourceforge.pmd.PropertySource

`definePropertyDescriptor, dysfunctionReason, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, ignoredProperties, setProperty, useDefaultValueFor, usesDefaultValues`

### Constructor Detail

#### MockRule

    public MockRule()

#### MockRule

    public MockRule(String name,
            String description,
            String message,
            String ruleSetName,
            RulePriority priority)

#### MockRule

    public MockRule(String name,
            String description,
            String message,
            String ruleSetName)

### 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.