Class AbstractClassCouplingCheck

    • Constructor Detail

      • AbstractClassCouplingCheck

        protected AbstractClassCouplingCheck​(int defaultMax)
        Creates new instance of the check.
        Parameters:
        defaultMax - default value for allowed complexity.
    • Method Detail

      • getLogMessageId

        protected abstract java.lang.String getLogMessageId()
        Returns message key we use for log violations.
        Returns:
        message key we use for log violations.
      • getDefaultTokens

        public final int[] getDefaultTokens()
        Description copied from class: AbstractCheck
        Returns the default token a check is interested in. Only used if the configuration for a check does not define the tokens.
        Specified by:
        getDefaultTokens in class AbstractCheck
        Returns:
        the default tokens
        See Also:
        TokenTypes
      • setMax

        public final void setMax​(int max)
        Setter to specify the maximum threshold allowed.
        Parameters:
        max - allowed complexity.
      • setExcludedClasses

        public final void setExcludedClasses​(java.lang.String... excludedClasses)
        Setter to specify user-configured class names to ignore.
        Parameters:
        excludedClasses - the list of classes to ignore.
      • setExcludeClassesRegexps

        public void setExcludeClassesRegexps​(java.lang.String... from)
        Setter to specify user-configured regular expressions to ignore classes.
        Parameters:
        from - array representing regular expressions of classes to ignore.
      • setExcludedPackages

        public final void setExcludedPackages​(java.lang.String... excludedPackages)
        Setter to specify user-configured packages to ignore. All excluded packages should end with a period, so it also appends a dot to a package name.
        Parameters:
        excludedPackages - the list of packages to ignore.
      • beginTree

        public final void beginTree​(DetailAST ast)
        Description copied from class: AbstractCheck
        Called before the starting to process a tree. Ideal place to initialize information that is to be collected whilst processing a tree.
        Overrides:
        beginTree in class AbstractCheck
        Parameters:
        ast - the root of the tree
      • leaveToken

        public void leaveToken​(DetailAST ast)
        Description copied from class: AbstractCheck
        Called after all the child nodes have been process.
        Overrides:
        leaveToken in class AbstractCheck
        Parameters:
        ast - the token leaving