Class FinalClassCheck.TypeDeclarationDescription

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.design.FinalClassCheck.TypeDeclarationDescription
Direct Known Subclasses:
FinalClassCheck.ClassDesc
Enclosing class:
FinalClassCheck

Maintains information about the type of declaration. Any ast node of type 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. It does not maintain information about classes, a subclass called FinalClassCheck.ClassDesc does that job.
  • Field Details

    • 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

      Type declaration ast node.
  • Constructor Details

    • 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 declaration
      typeDeclarationAst - Type declaration ast node
  • Method Details

    • 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

      Get the type declaration ast node.
      Returns:
      ast node of the type declaration