Class AbstractDeclarationCollector

  • All Implemented Interfaces:
    Configurable, Contextualizable

    @Deprecated
    public abstract class AbstractDeclarationCollector
    extends AbstractCheck
    Deprecated.
    Checkstyle will not support abstract checks anymore. Use AbstractCheck instead.
    Abstract class for checks which need to collect information about declared members/parameters/variables.
    • Constructor Detail

      • AbstractDeclarationCollector

        public AbstractDeclarationCollector()
        Deprecated.
    • Method Detail

      • beginTree

        public void beginTree​(DetailAST rootAST)
        Deprecated.
        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:
        rootAST - the root of the tree
      • visitToken

        public void visitToken​(DetailAST ast)
        Deprecated.
        Description copied from class: AbstractCheck
        Called to process a token.
        Overrides:
        visitToken in class AbstractCheck
        Parameters:
        ast - the token to process
      • collectDeclarations

        private static void collectDeclarations​(java.util.Deque<AbstractDeclarationCollector.LexicalFrame> frameStack,
                                                DetailAST ast)
        Deprecated.
        Parse the next AST for declarations.
        Parameters:
        frameStack - Stack containing the FrameTree being built
        ast - AST to parse
      • endCollectingDeclarations

        private void endCollectingDeclarations​(java.util.Queue<AbstractDeclarationCollector.LexicalFrame> frameStack,
                                               DetailAST ast)
        Deprecated.
        End parsing of the AST for declarations.
        Parameters:
        frameStack - Stack containing the FrameTree being built
        ast - AST that was parsed
      • isClassField

        protected final boolean isClassField​(java.lang.String name)
        Deprecated.
        Check if given name is a name for class field in current environment.
        Parameters:
        name - a name to check
        Returns:
        true is the given name is name of member.
      • isClassMethod

        protected final boolean isClassMethod​(java.lang.String name)
        Deprecated.
        Check if given name is a name for class method in current environment.
        Parameters:
        name - a name to check
        Returns:
        true is the given name is name of method.
      • findFrame

        private AbstractDeclarationCollector.LexicalFrame findFrame​(java.lang.String name)
        Deprecated.
        Find frame containing declaration.
        Parameters:
        name - name of the declaration to find
        Returns:
        LexicalFrame containing declaration or null