Class UnnecessaryConstructorRule
- 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.internal.AbstractIgnoredAnnotationRule
-
- net.sourceforge.pmd.lang.java.rule.codestyle.UnnecessaryConstructorRule
-
- All Implemented Interfaces:
net.sourceforge.pmd.lang.ast.AstVisitor
,JavaVisitor
,net.sourceforge.pmd.lang.rule.Rule
,net.sourceforge.pmd.properties.PropertySource
public class UnnecessaryConstructorRule extends net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
This rule detects when a constructor is not necessary; i.e., when there is only one constructor, it’s public, has an empty body, and takes no arguments.
-
-
Constructor Summary
Constructors Constructor Description UnnecessaryConstructorRule()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected @NonNull net.sourceforge.pmd.lang.rule.RuleTargetSelector
buildTargetSelector()
protected Collection<String>
defaultSuppressionAnnotations()
Object
visit(ASTClassDeclaration node, Object data)
Object
visit(ASTEnumDeclaration node, Object data)
-
Methods inherited from class net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
defaultIgnoredAnnotationsDescription, hasIgnoredAnnotation
-
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.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, visitJavaNode
-
Methods inherited from interface net.sourceforge.pmd.properties.PropertySource
definePropertyDescriptor, dysfunctionReason, getOverriddenPropertiesByPropertyDescriptor, getOverriddenPropertyDescriptors, getPropertiesByPropertyDescriptor, getProperty, getPropertyDescriptor, getPropertyDescriptors, hasDescriptor, isPropertyOverridden, setProperty
-
-
-
-
Method Detail
-
buildTargetSelector
protected @NonNull net.sourceforge.pmd.lang.rule.RuleTargetSelector buildTargetSelector()
- Overrides:
buildTargetSelector
in classnet.sourceforge.pmd.lang.rule.AbstractRule
-
defaultSuppressionAnnotations
protected Collection<String> defaultSuppressionAnnotations()
- Overrides:
defaultSuppressionAnnotations
in classnet.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
-
visit
public Object visit(ASTClassDeclaration node, Object data)
-
visit
public Object visit(ASTEnumDeclaration node, Object data)
-
-