public final class FullIdent extends java.lang.Object
Identifiers such as java.util.HashMap are spread across
multiple AST nodes in the syntax tree (three IDENT nodes, two DOT nodes).
A FullIdent represents the whole String (excluding any intermediate
whitespace), which is often easier to work with in Checks.
TokenTypes.DOT,
TokenTypes.IDENT| Modifier and Type | Field and Description |
|---|---|
private DetailAST |
detailAst
The topmost and leftmost AST of the full identifier.
|
private java.util.List<java.lang.String> |
elements
The list holding subsequent elements of identifier.
|
| Modifier | Constructor and Description |
|---|---|
private |
FullIdent()
Hide default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
append(DetailAST ast)
Append the specified token and also recalibrate the first line and
column.
|
private void |
append(java.lang.String text)
Append the specified text.
|
private static void |
appendBrackets(FullIdent full,
DetailAST ast)
Appends the brackets of an array type to a
FullIdent. |
static FullIdent |
createFullIdent(DetailAST ast)
Creates a new FullIdent starting from the specified node.
|
static FullIdent |
createFullIdentBelow(DetailAST ast)
Creates a new FullIdent starting from the child of the specified node.
|
private static void |
extractFullIdent(FullIdent full,
DetailAST ast)
Recursively extract a FullIdent.
|
int |
getColumnNo()
Gets the column number.
|
DetailAST |
getDetailAst()
Gets the topmost leftmost DetailAST for this FullIdent.
|
int |
getLineNo()
Gets the line number.
|
java.lang.String |
getText()
Gets the text.
|
private static boolean |
isArrayTypeDeclaration(DetailAST arrayDeclarator)
Checks an `ARRAY_DECLARATOR` ast to verify that it is not a
array initialization, i.e.
|
java.lang.String |
toString() |
private final java.util.List<java.lang.String> elements
private FullIdent()
public static FullIdent createFullIdentBelow(DetailAST ast)
ast - the parent node from where to start fromFullIdent valuepublic static FullIdent createFullIdent(DetailAST ast)
ast - the node to start fromFullIdent valueprivate static void extractFullIdent(FullIdent full, DetailAST ast)
full - the FullIdent to add toast - the node to recurse fromprivate static boolean isArrayTypeDeclaration(DetailAST arrayDeclarator)
arrayDeclarator - the first ARRAY_DECLARATOR token in the astprivate static void appendBrackets(FullIdent full, DetailAST ast)
FullIdent.full - the FullIdent to append brackets toast - the type ast we are building a FullIdent forpublic java.lang.String getText()
public DetailAST getDetailAst()
public int getLineNo()
public int getColumnNo()
public java.lang.String toString()
toString in class java.lang.Objectprivate void append(java.lang.String text)
text - the text to appendCopyright © 2001-2022. All Rights Reserved.