public abstract class LombokNode<A extends AST<A,L,N>,L extends LombokNode<A,L,N>,N> extends java.lang.Object implements DiagnosticsReceiver
Modifier and Type | Field and Description |
---|---|
protected A |
ast |
protected lombok.core.LombokImmutableList<L> |
children |
protected boolean |
isStructurallySignificant
structurally significant are those nodes that can be annotated in java 1.6 or are method-like toplevels,
so fields, local declarations, method arguments, methods, types, the Compilation Unit itself, and initializers.
|
protected AST.Kind |
kind |
protected N |
node |
protected L |
parent |
CONSOLE
Modifier | Constructor and Description |
---|---|
protected |
LombokNode(A ast,
N node,
java.util.List<L> children,
AST.Kind kind)
Creates a new Node object that represents the provided node.
|
Modifier and Type | Method and Description |
---|---|
L |
add(N newChild,
AST.Kind newChildKind)
Adds the stated node as a direct child of this node.
|
protected abstract boolean |
calculateIsStructurallySignificant(N parent)
|
L |
directUp()
Returns the direct parent node in the AST tree of this node.
|
lombok.core.LombokImmutableList<L> |
down()
Returns all children nodes.
|
protected abstract boolean |
fieldContainsAnnotation(N field,
N annotation)
Return
true if the annotation is attached to the field. |
N |
get() |
A |
getAst() |
java.lang.String |
getFileName()
Convenient shortcut to the owning ast object's getFileName method.
|
ImportList |
getImportList()
Convenient shortcut to the owning ast object's
getImportList method. |
AST.Kind |
getKind() |
int |
getLatestJavaSpecSupported()
Convenient shortcut to the owning ast object's getLatestJavaSpecSupported method.
|
abstract java.lang.String |
getName()
Return the name of your type (simple name), method, field, or local variable.
|
L |
getNodeFor(N obj)
Convenient shortcut to the owning ast object's get method.
|
java.lang.String |
getPackageDeclaration()
Convenient shortcut to the owning ast object's
getPackageDeclaration method. |
int |
getSourceVersion()
Convenient shortcut to the owning ast object's getSourceVersion method.
|
boolean |
isStructurallySignificant()
Structurally significant means: LocalDeclaration, TypeDeclaration, MethodDeclaration, ConstructorDeclaration,
FieldDeclaration, Initializer, and CompilationUnitDeclaration.
|
void |
rebuild()
Reparses the AST node represented by this node.
|
void |
removeChild(L child)
Removes the stated node, which must be a direct child of this node, from the AST.
|
L |
top()
Convenient shortcut to the owning ast object's top method.
|
java.lang.String |
toString() |
L |
up()
Returns the structurally significant node that encloses this one.
|
java.util.Collection<L> |
upFromAnnotationToFields()
@Foo int x, y; is stored in both javac and ecj as 2 FieldDeclarations, both with the same annotation as child. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addWarning
protected final AST.Kind kind
protected final N node
protected lombok.core.LombokImmutableList<L extends LombokNode<A,L,N>> children
protected L extends LombokNode<A,L,N> parent
protected boolean isStructurallySignificant
protected LombokNode(A ast, N node, java.util.List<L> children, AST.Kind kind)
ast
- The owning AST - this node is part of this AST's tree of nodes.node
- The AST object in the target parser's own internal AST tree that this node object will represent.children
- A list of child nodes. Passing in null results in the children list being empty, not null.kind
- The kind of node represented by this object.public A getAst()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getPackageDeclaration()
getPackageDeclaration
method.AST.getPackageDeclaration()
public ImportList getImportList()
getImportList
method.AST.getImportList()
protected abstract boolean calculateIsStructurallySignificant(N parent)
public L getNodeFor(N obj)
AST.get(Object)
public N get()
public AST.Kind getKind()
public abstract java.lang.String getName()
public L up()
isStructurallySignificant()
public java.util.Collection<L> upFromAnnotationToFields()
@Foo int x, y;
is stored in both javac and ecj as 2 FieldDeclarations, both with the same annotation as child.
The normal up()
method can't handle having multiple parents, but this one can.protected abstract boolean fieldContainsAnnotation(N field, N annotation)
true
if the annotation is attached to the field.public L directUp()
up()
LombokNode
is the Method
that contains it.public lombok.core.LombokImmutableList<L> down()
public int getLatestJavaSpecSupported()
AST.getLatestJavaSpecSupported()
public int getSourceVersion()
AST.getSourceVersion()
public java.lang.String getFileName()
AST.getFileName()
public L add(N newChild, AST.Kind newChildKind)
public void rebuild()
public void removeChild(L child)
public boolean isStructurallySignificant()
Copyright © 2009-2015 The Project Lombok Authors, licensed under the MIT licence.