Class AbstractAstVisitorRule

    • Field Detail

      • DEFAULT_CONST_NAME

        protected static final java.lang.String DEFAULT_CONST_NAME
        See Also:
        Constant Field Values
      • DEFAULT_FIELD_NAME

        protected static final java.lang.String DEFAULT_FIELD_NAME
        See Also:
        Constant Field Values
      • DEFAULT_VAR_NAME

        protected static final java.lang.String DEFAULT_VAR_NAME
        See Also:
        Constant Field Values
      • DEFAULT_TEST_FILES

        protected static final java.lang.String DEFAULT_TEST_FILES
        See Also:
        Constant Field Values
      • DEFAULT_TEST_CLASS_NAMES

        protected static final java.lang.String DEFAULT_TEST_CLASS_NAMES
        See Also:
        Constant Field Values
      • applyToClassNames

        private java.lang.String applyToClassNames
        This rule is only applied to classes with names matching this value. The value may optionally be a comma-separated list of names, in which case one of the names must match. If a name includes a period ('.'), then it is assumed to specify a full package name, so the name (pattern) is matched against each fully-qualified class name. Otherwise it is matched only against the class name without a package. The name(s) may optionally include wildcard characters ('*' or '?').
      • doNotApplyToClassNames

        private java.lang.String doNotApplyToClassNames
        This rule is NOT applied to classes with names matching this value. The value may optionally be a comma-separated list of names, in which case any one of the names can match. If a name includes a period ('.'), then it is assumed to specify a full package name, so the name (pattern) is matched against each fully-qualified class name. Otherwise it is matched only against the class name without a package. The name(s) may optionally include wildcard characters ('*' or '?').
    • Constructor Detail

      • AbstractAstVisitorRule

        public AbstractAstVisitorRule()
    • Method Detail

      • getAstVisitorClass

        protected java.lang.Class getAstVisitorClass()
        Each concrete subclass must either set this property or define its own property with the same name
      • getAstVisitor

        public AstVisitor getAstVisitor()
      • applyTo

        public void applyTo​(SourceCode sourceCode,
                            java.util.List<Violation> violations)
        Description copied from class: AbstractRule
        Apply this rule to the specified source and return a list of violations (or an empty List)
        Specified by:
        applyTo in class AbstractRule
        Parameters:
        sourceCode - - the source to apply this rule to
        violations - - the List of violations to which new violations from this rule are to be added
      • shouldApplyThisRuleTo

        protected boolean shouldApplyThisRuleTo​(org.codehaus.groovy.ast.ClassNode classNode)
        Return true if this rule should be applied for the specified ClassNode, based on the configuration of this rule.
        Parameters:
        classNode - - the ClassNode
        Returns:
        true if this rule should be applied for the specified ClassNode
      • getApplyToClassNames

        public java.lang.String getApplyToClassNames()
      • setApplyToClassNames

        public void setApplyToClassNames​(java.lang.String applyToClassNames)
      • getDoNotApplyToClassNames

        public java.lang.String getDoNotApplyToClassNames()
      • setDoNotApplyToClassNames

        public void setDoNotApplyToClassNames​(java.lang.String doNotApplyToClassNames)