private static class UnusedLocalVariableCheck.TypeDeclDesc extends java.lang.Object
TokenTypes.CLASS_DEF or TokenTypes.INTERFACE_DEF
or TokenTypes.ENUM_DEF or TokenTypes.ANNOTATION_DEF
or TokenTypes.RECORD_DEF is considered as a type declaration.| Modifier and Type | Field and Description |
|---|---|
private int |
depth
Depth of nesting of type declaration.
|
private java.util.Deque<UnusedLocalVariableCheck.VariableDesc> |
instanceAndClassVarStack
A stack of type declaration's instance and static variables.
|
private java.lang.String |
qualifiedName
Complete type declaration name with package name and outer type declaration name.
|
private DetailAST |
typeDeclAst
Type declaration ast node.
|
| Constructor and Description |
|---|
TypeDeclDesc(java.lang.String qualifiedName,
int depth,
DetailAST typeDeclAst)
Create a new TypeDeclDesc instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addInstOrClassVar(UnusedLocalVariableCheck.VariableDesc variableDesc)
Add an instance variable or class variable to the stack.
|
int |
getDepth()
Get the depth of type declaration.
|
java.lang.String |
getQualifiedName()
Get the complete type declaration name i.e.
|
DetailAST |
getTypeDeclAst()
Get the type declaration ast node.
|
java.util.Deque<UnusedLocalVariableCheck.VariableDesc> |
getUpdatedCopyOfVarStack(DetailAST literalNewAst)
Get the copy of variables in instanceAndClassVar stack with updated scope.
|
private final java.lang.String qualifiedName
private final int depth
private final DetailAST typeDeclAst
private final java.util.Deque<UnusedLocalVariableCheck.VariableDesc> instanceAndClassVarStack
TypeDeclDesc(java.lang.String qualifiedName, int depth, DetailAST typeDeclAst)
qualifiedName - qualified namedepth - depth of nestingtypeDeclAst - type declaration ast nodepublic java.lang.String getQualifiedName()
public int getDepth()
public DetailAST getTypeDeclAst()
public java.util.Deque<UnusedLocalVariableCheck.VariableDesc> getUpdatedCopyOfVarStack(DetailAST literalNewAst)
literalNewAst - ast node of type TokenTypes.LITERAL_NEWpublic void addInstOrClassVar(UnusedLocalVariableCheck.VariableDesc variableDesc)
variableDesc - variable to be addedCopyright © 2001-2022. All Rights Reserved.