Class UnusedLocalVariableCheck.TypeDeclDesc

    • Field Detail

      • qualifiedName

        private final java.lang.String qualifiedName
        Complete type declaration name with package name and outer type declaration name.
      • depth

        private final int depth
        Depth of nesting of type declaration.
      • typeDeclAst

        private final DetailAST typeDeclAst
        Type declaration ast node.
    • Constructor Detail

      • TypeDeclDesc

        TypeDeclDesc​(java.lang.String qualifiedName,
                     int depth,
                     DetailAST typeDeclAst)
        Create a new TypeDeclDesc instance.
        Parameters:
        qualifiedName - qualified name
        depth - depth of nesting
        typeDeclAst - type declaration ast node
    • Method Detail

      • getQualifiedName

        public java.lang.String getQualifiedName()
        Get the complete type declaration name i.e. type declaration name with package name and outer type declaration name.
        Returns:
        qualified class name
      • getDepth

        public int getDepth()
        Get the depth of type declaration.
        Returns:
        the depth of nesting of type declaration
      • getTypeDeclAst

        public DetailAST getTypeDeclAst()
        Get the type declaration ast node.
        Returns:
        ast node of the type declaration
      • getUpdatedCopyOfVarStack

        public java.util.Deque<UnusedLocalVariableCheck.VariableDesc> getUpdatedCopyOfVarStack​(DetailAST literalNewAst)
        Get the copy of variables in instanceAndClassVar stack with updated scope.
        Parameters:
        literalNewAst - ast node of type TokenTypes.LITERAL_NEW
        Returns:
        copy of variables in instanceAndClassVar stack with updated scope.
      • addInstOrClassVar

        public void addInstOrClassVar​(UnusedLocalVariableCheck.VariableDesc variableDesc)
        Add an instance variable or class variable to the stack.
        Parameters:
        variableDesc - variable to be added