Class CustomImportOrderCheck.ImportDetails
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.imports.CustomImportOrderCheck.ImportDetails
-
- Enclosing class:
- CustomImportOrderCheck
private static final class CustomImportOrderCheck.ImportDetails extends Object
Contains import attributes as line number, import full path, import group.
-
-
Field Summary
Fields Modifier and Type Field Description private DetailAST
importAST
Import AST.private String
importFullPath
Import full path.private String
importGroup
Import group.private boolean
staticImport
Is static import.
-
Constructor Summary
Constructors Modifier Constructor Description private
ImportDetails(String importFullPath, String importGroup, boolean staticImport, DetailAST importAST)
Initialise importFullPath, importGroup, staticImport, importAST.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getEndLineNumber()
Get import end line number from ast.DetailAST
getImportAST()
Get import ast.String
getImportFullPath()
Get import full path variable.String
getImportGroup()
Get import group.int
getStartLineNumber()
Get import start line number from ast.boolean
isStaticImport()
Checks if import is static.
-
-
-
Field Detail
-
importFullPath
private final String importFullPath
Import full path.
-
importGroup
private final String importGroup
Import group.
-
staticImport
private final boolean staticImport
Is static import.
-
-
Constructor Detail
-
ImportDetails
private 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 Detail
-
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.
-
-