|
Lombok - v0.10.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectlombok.core.LombokNode<A,L,N>
public abstract class LombokNode<A extends AST<A,L,N>,L extends LombokNode<A,L,N>,N>
An instance of this class wraps an Eclipse/javac internal node object.
| Field Summary | |
|---|---|
protected A |
ast
|
protected List<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
|
| Fields inherited from interface lombok.core.DiagnosticsReceiver |
|---|
CONSOLE |
| Constructor Summary | |
|---|---|
protected |
LombokNode(A ast,
N node,
List<L> children,
AST.Kind kind)
Creates a new Node object that represents the provided node. |
| Method Summary | |
|---|---|
L |
add(N newChild,
AST.Kind newChildKind)
Adds the stated node as a direct child of this node. |
protected abstract boolean |
calculateIsStructurallySignificant(N parent)
See isStructurallySignificant. |
L |
directUp()
Returns the direct parent node in the AST tree of this node. |
Collection<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()
|
String |
getFileName()
Convenient shortcut to the owning ast object's getFileName method. |
Collection<String> |
getImportStatements()
Convenient shortcut to the owning ast object's getImportStatements method. |
AST.Kind |
getKind()
|
abstract 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. |
String |
getPackageDeclaration()
Convenient shortcut to the owning ast object's getPackageDeclaration 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. |
void |
replaceChildNode(N oldN,
N newN)
Replaces the stated node with a new one. |
L |
replaceWith(N newN,
AST.Kind newNodeKind)
Replaces the AST node represented by this node object with the provided node. |
L |
top()
Convenient shortcut to the owning ast object's top method. |
String |
toString()
|
L |
up()
Returns the structurally significant node that encloses this one. |
Collection<L> |
upFromAnnotationToFields()
@Foo int x, y; is stored in both javac and ecj as 2 FieldDeclarations, both with the same annotation as child. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface lombok.core.DiagnosticsReceiver |
|---|
addError, addWarning |
| Field Detail |
|---|
protected final A extends AST<A,L,N> ast
protected final AST.Kind kind
protected final N node
protected final List<L extends LombokNode<A,L,N>> children
protected L extends LombokNode<A,L,N> parent
protected boolean isStructurallySignificant
| Constructor Detail |
|---|
protected LombokNode(A ast,
N node,
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.| Method Detail |
|---|
public A getAst()
public String toString()
toString in class Objectpublic String getPackageDeclaration()
getPackageDeclaration method.
AST.getPackageDeclaration()public Collection<String> getImportStatements()
getImportStatements method.
AST.getImportStatements()protected abstract boolean calculateIsStructurallySignificant(N parent)
isStructurallySignificant.
public L getNodeFor(N obj)
AST.get(Object)public N get()
public L replaceWith(N newN,
AST.Kind newNodeKind)
public void replaceChildNode(N oldN,
N newN)
public AST.Kind getKind()
public abstract String getName()
public L up()
isStructurallySignificant()public 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 Collection<L> down()
ConcurrentModificationExceptions.
public L top()
AST.top()public String getFileName()
AST.getFileName()
public L add(N newChild,
AST.Kind newChildKind)
public void rebuild()
public void removeChild(L child)
public boolean isStructurallySignificant()
|
Lombok - v0.10.8 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||