Class FinalClassCheck.TypeDeclarationDescription
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.TypeDeclarationDescription
-
- Direct Known Subclasses:
FinalClassCheck.ClassDesc
- Enclosing class:
- FinalClassCheck
private static class FinalClassCheck.TypeDeclarationDescription extends Object
Maintains information about the type of declaration. Any ast node of typeTokenTypes.CLASS_DEF
orTokenTypes.INTERFACE_DEF
orTokenTypes.ENUM_DEF
orTokenTypes.ANNOTATION_DEF
orTokenTypes.RECORD_DEF
is considered as a type declaration. It does not maintain information about classes, a subclass calledFinalClassCheck.ClassDesc
does that job.
-
-
Field Summary
Fields Modifier and Type Field Description private int
depth
Depth of nesting of type declaration.private String
qualifiedName
Complete type declaration name with package name and outer type declaration name.private DetailAST
typeDeclarationAst
Type declaration ast node.
-
Constructor Summary
Constructors Modifier Constructor Description private
TypeDeclarationDescription(String qualifiedName, int depth, DetailAST typeDeclarationAst)
Create an instance of TypeDeclarationDescription.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
getDepth()
Get the depth of type declaration.protected String
getQualifiedName()
Get the complete type declaration name i.e. type declaration name with package name and outer type declaration name.protected DetailAST
getTypeDeclarationAst()
Get the type declaration ast node.
-
-
-
Field Detail
-
qualifiedName
private final 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.
-
typeDeclarationAst
private final DetailAST typeDeclarationAst
Type declaration ast node.
-
-
Constructor Detail
-
TypeDeclarationDescription
private TypeDeclarationDescription(String qualifiedName, int depth, DetailAST typeDeclarationAst)
Create an instance of TypeDeclarationDescription.- Parameters:
qualifiedName
- Complete type declaration name with package name and outer type declaration name.depth
- Depth of nesting of type declarationtypeDeclarationAst
- Type declaration ast node
-
-
Method Detail
-
getQualifiedName
protected 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
protected int getDepth()
Get the depth of type declaration.- Returns:
- the depth of nesting of type declaration
-
getTypeDeclarationAst
protected DetailAST getTypeDeclarationAst()
Get the type declaration ast node.- Returns:
- ast node of the type declaration
-
-