Class CustomImportOrderCheck.ImportDetails

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck.ImportDetails
Enclosing class:
CustomImportOrderCheck

private static class CustomImportOrderCheck.ImportDetails extends Object
Contains import attributes as line number, import full path, import group.
  • Field Details

    • importFullPath

      private final String importFullPath
      Import full path.
    • importGroup

      private final String importGroup
      Import group.
    • staticImport

      private final boolean staticImport
      Is static import.
    • importAST

      private final DetailAST importAST
      Import AST.
  • Constructor Details

    • ImportDetails

      ImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST)
      Initialise importFullPath, importGroup, staticImport, importAST.
      Parameters:
      importFullPath - import full path.
      importGroup - import group.
      staticImport - if import is static.
      importAST - import ast
  • Method Details

    • getImportFullPath

      public String getImportFullPath()
      Get import full path variable.
      Returns:
      import full path variable.
    • getStartLineNumber

      public int getStartLineNumber()
      Get import start line number from ast.
      Returns:
      import start line from ast.
    • getEndLineNumber

      public int getEndLineNumber()
      Get import end line number from ast.

      Note: It can be different from startLineNumber when import statement span multiple lines.

      Returns:
      import end line from ast.
    • getImportGroup

      public String getImportGroup()
      Get import group.
      Returns:
      import group.
    • isStaticImport

      public boolean isStaticImport()
      Checks if import is static.
      Returns:
      true, if import is static.
    • getImportAST

      public DetailAST getImportAST()
      Get import ast.
      Returns:
      import ast.