Class AtLeastOneConstructorRule

  • All Implemented Interfaces:
    net.sourceforge.pmd.lang.ast.AstVisitor, JavaVisitor, net.sourceforge.pmd.lang.rule.Rule, net.sourceforge.pmd.properties.PropertySource

    public class AtLeastOneConstructorRule
    extends net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule
    This rule detects non-static classes with no constructors; requiring even the default constructor to be explicit. It ignores classes with solely static methods, use UseUtilityClassRule to flag those.
    • Constructor Detail

      • AtLeastOneConstructorRule

        public AtLeastOneConstructorRule()
    • Method Detail

      • buildTargetSelector

        protected @NonNull net.sourceforge.pmd.lang.rule.RuleTargetSelector buildTargetSelector()
        Overrides:
        buildTargetSelector in class net.sourceforge.pmd.lang.rule.AbstractRule
      • defaultSuppressionAnnotations

        protected Collection<String> defaultSuppressionAnnotations()
        Overrides:
        defaultSuppressionAnnotations in class net.sourceforge.pmd.lang.java.rule.internal.AbstractIgnoredAnnotationRule