Class AbstractJavaRulechainRule
- java.lang.Object
-
- net.sourceforge.pmd.properties.AbstractPropertySource
-
- net.sourceforge.pmd.lang.rule.AbstractRule
-
- net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
-
- net.sourceforge.pmd.lang.java.rule.AbstractJavaRulechainRule
-
- All Implemented Interfaces:
AstVisitor
,JavaVisitor
,Rule
,PropertySource
- Direct Known Subclasses:
AbstractClassWithoutAbstractMethodRule
,net.sourceforge.pmd.lang.java.rule.internal.AbstractJavaCounterCheckRule
,AccessorClassGenerationRule
,AccessorMethodGenerationRule
,AddEmptyStringRule
,AppendCharacterWithCharRule
,ArrayIsStoredDirectlyRule
,AssignmentInOperandRule
,AssignmentToNonFinalStaticRule
,AvoidBranchingStatementAsLastInLoopRule
,AvoidDuplicateLiteralsRule
,AvoidInstantiatingObjectsInLoopsRule
,AvoidReassigningLoopVariablesRule
,AvoidReassigningParametersRule
,AvoidThrowingNullPointerExceptionRule
,AvoidUsingHardCodedIPRule
,AvoidUsingOctalValuesRule
,BigIntegerInstantiationRule
,BrokenNullCheckRule
,CheckSkipResultRule
,ClassNamingConventionsRule
,ClassWithOnlyPrivateConstructorsShouldBeFinalRule
,CloneMethodMustImplementCloneableRule
,CognitiveComplexityRule
,CommentContentRule
,CommentDefaultAccessModifierRule
,CommentRequiredRule
,CommentSizeRule
,ConfusingArgumentToVarargsMethodRule
,ConfusingTernaryRule
,ConsecutiveLiteralAppendsRule
,ConstructorCallsOverridableMethodRule
,CyclomaticComplexityRule
,DataClassRule
,DetachedTestCaseRule
,EmptyControlStatementRule
,ExceptionAsFlowControlRule
,FieldDeclarationsShouldBeAtStartOfClassRule
,FieldNamingConventionsRule
,ForLoopCanBeForeachRule
,FormalParameterNamingConventionsRule
,GodClassRule
,GuardLogStatementRule
,HardCodedCryptoKeyRule
,IdempotentOperationsRule
,IdenticalCatchBranchesRule
,ImmutableFieldRule
,ImplicitSwitchFallThroughRule
,InefficientEmptyStringCheckRule
,InefficientStringBufferingRule
,InsecureCryptoIvRule
,InsufficientStringBufferDeclarationRule
,InvalidJavaBeanRule
,InvalidLogMessageFormatRule
,JUnitSpellingRule
,JUnitStaticSuiteRule
,JUnitUseExpectedRule
,LambdaCanBeMethodReferenceRule
,LinguisticNamingRule
,LiteralsFirstInComparisonsRule
,LocalVariableCouldBeFinalRule
,LocalVariableNamingConventionsRule
,LooseCouplingRule
,MethodArgumentCouldBeFinalRule
,MethodNamingConventionsRule
,MethodReturnsInternalArrayRule
,MissingOverrideRule
,NcssCountRule
,NonSerializableClassRule
,NonThreadSafeSingletonRule
,NPathComplexityRule
,NullAssignmentRule
,OnlyOneReturnRule
,OverrideBothEqualsAndHashcodeRule
,PrematureDeclarationRule
,PreserveStackTraceRule
,PrimitiveWrapperInstantiationRule
,ProperCloneImplementationRule
,RedundantFieldInitializerRule
,SignatureDeclareThrowsExceptionRule
,SimplifiableTestAssertionRule
,SimplifyBooleanReturnsRule
,SimplifyConditionalRule
,SingleMethodSingletonRule
,SingletonClassReturningNewInstanceRule
,SingularFieldRule
,SuspiciousOctalEscapeRule
,SwitchDensityRule
,TestClassWithoutTestCasesRule
,UnitTestAssertionsShouldIncludeMessageRule
,UnitTestContainsTooManyAssertsRule
,UnitTestShouldIncludeAssertRule
,UnnecessaryBoxingRule
,UnnecessaryCaseChangeRule
,UnnecessaryCastRule
,UnnecessaryFullyQualifiedNameRule
,UnnecessaryLocalBeforeReturnRule
,UnnecessaryModifierRule
,UnnecessaryReturnRule
,UnnecessaryVarargsArrayCreationRule
,UnsynchronizedStaticFormatterRule
,UnusedAssignmentRule
,UnusedFormalParameterRule
,UnusedPrivateFieldRule
,UseCollectionIsEmptyRule
,UseDiamondOperatorRule
,UseEnumCollectionsRule
,UseIndexOfCharRule
,UselessOperationOnImmutableRule
,UselessOverridingMethodRule
,UselessParenthesesRule
,UseStringBufferForStringAppendsRule
,UseTryWithResourcesRule
,UseUtilityClassRule
public abstract class AbstractJavaRulechainRule extends AbstractJavaRule
Base class for rules using the rulechain. The visit methods don't recurse by default.- Author:
- Clément Fournier
- Since:
- 7.0.0
-
-
Field Summary
-
Fields inherited from interface net.sourceforge.pmd.lang.rule.Rule
VIOLATION_SUPPRESS_REGEX_DESCRIPTOR, VIOLATION_SUPPRESS_XPATH_DESCRIPTOR
-
-
Constructor Summary
Constructors Constructor Description AbstractJavaRulechainRule(Class<? extends JavaNode> first, Class<? extends JavaNode>... visits)
Specify the node types to visit as parameters.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NonNull RuleTargetSelector
buildTargetSelector()
Object
visitJavaNode(JavaNode node, Object data)
-
Methods inherited from class net.sourceforge.pmd.lang.java.rule.AbstractJavaRule
apply, visitNode
-
Methods inherited from class net.sourceforge.pmd.lang.rule.AbstractRule
addExample, asCtx, deepCopy, 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
definePropertyDescriptor, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.sourceforge.pmd.lang.ast.AstVisitor
cannotVisit
-
Methods inherited from interface net.sourceforge.pmd.lang.java.ast.JavaVisitor
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
-
Methods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty
-
Methods inherited from interface net.sourceforge.pmd.lang.rule.Rule
initialize
-
-
-
-
Constructor Detail
-
AbstractJavaRulechainRule
@SafeVarargs public AbstractJavaRulechainRule(Class<? extends JavaNode> first, Class<? extends JavaNode>... visits)
Specify the node types to visit as parameters.- Parameters:
first
- The first node, there must be at least onevisits
- The rest
-
-
Method Detail
-
buildTargetSelector
protected final @NonNull RuleTargetSelector buildTargetSelector()
- Overrides:
buildTargetSelector
in classAbstractRule
-
-