Class AntlrBaseRule
- java.lang.Object
-
- net.sourceforge.pmd.properties.AbstractPropertySource
-
- net.sourceforge.pmd.lang.rule.AbstractRule
-
- net.sourceforge.pmd.lang.ast.impl.antlr4.AntlrBaseRule
-
- All Implemented Interfaces:
PropertySource
,Rule
public abstract class AntlrBaseRule extends AbstractRule
Base implementation of an antlr rule.
-
-
Field Summary
-
Fields inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
propertyDescriptors, propertyValuesByDescriptor
-
Fields inherited from interface net.sourceforge.pmd.Rule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AntlrBaseRule()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
apply(Node target, RuleContext ctx)
Process the given node.abstract AstVisitor<RuleContext,?>
buildVisitor()
Returns a rule visitor that can visit nodes for the given rule context.-
Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule
addExample, addRuleChainVisit, addViolation, addViolation, addViolation, addViolationWithMessage, addViolationWithMessage, addViolationWithMessage, asCtx, buildTargetSelector, deepCopy, deepCopyValuesTo, end, equals, getDescription, getExamples, getExternalInfoUrl, getLanguage, getMaximumLanguageVersion, getMessage, getMinimumLanguageVersion, getName, getPriority, getPropertySourceType, getRuleClass, getRuleSetName, getSince, getTargetSelector, hashCode, isDeprecated, setDeprecated, setDescription, setExternalInfoUrl, setLanguage, setMaximumLanguageVersion, setMessage, setMinimumLanguageVersion, setName, setPriority, setRuleClass, setRuleSetName, setSince, start
-
Methods inherited from class net.sourceforge.pmd.properties.AbstractPropertySource
copyPropertyDescriptors, copyPropertyValues, definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty, setProperty
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty, setProperty
-
Methods inherited from interface net.sourceforge.pmd.Rule
initialize
-
-
-
-
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 byRule.getTargetSelector()
.- Parameters:
target
- Node on which to apply the rulectx
- 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.- Returns:
- A visitor bound to the given rule context
-
-