|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlombok.ast.Modifiers
public class Modifiers
Constructor Summary | |
---|---|
Modifiers()
|
Method Summary | |
---|---|
void |
accept(AstVisitor visitor)
|
Node |
addMessage(Message message)
|
protected lombok.ast.AbstractNode |
adopt(lombok.ast.AbstractNode child)
Adopts (accepts as direct child) the provided node. |
StrictListAccessor<Annotation,Modifiers> |
astAnnotations()
|
StrictListAccessor<KeywordModifier,Modifiers> |
astKeywords()
|
Modifiers |
copy()
|
boolean |
detach(Node child)
If the provided child node is a child of this node, the child/parent link will be deleted. |
protected void |
disown(lombok.ast.AbstractNode child)
Disowns a direct child (it will be parentless after this call). |
protected void |
ensureParentage(lombok.ast.AbstractNode child)
Checks if the provided node is a direct child of this node. |
protected void |
ensureParentless()
Checks if this node is currently parentless. |
List<Node> |
getChildren()
|
int |
getEffectiveModifierFlags()
Returns the keyword-based modifiers the way Modifiers works. |
int |
getExplicitModifierFlags()
Returns the keyword-based modifiers the way Modifiers works. |
Node |
getGeneratedBy()
Returns the node that is responsible for generating this node. |
List<Message> |
getMessages()
|
boolean |
hasMessage(String key)
|
boolean |
hasParent()
|
boolean |
isAbstract()
|
boolean |
isEmpty()
|
boolean |
isFinal()
|
boolean |
isGenerated()
Returns true if this node is generated (not actually present in the source). |
boolean |
isPackagePrivate()
|
boolean |
isPrivate()
|
boolean |
isProtected()
|
boolean |
isPublic()
|
boolean |
isStatic()
|
boolean |
isTransient()
|
RawListAccessor<Annotation,Modifiers> |
rawAnnotations()
|
RawListAccessor<KeywordModifier,Modifiers> |
rawKeywords()
|
boolean |
replace(Node replacement)
Replaces this node with the replacement. |
boolean |
replaceChild(Node original,
Node replacement)
If the provided child node is a child of this node, the child/parent link will be deleted. |
Node |
setPosition(Position position)
|
String |
toString()
|
void |
unparent()
Severs the child/parent link between this node and its parent. |
AnnotationDeclaration |
upToAnnotationDeclaration()
|
AnnotationMethodDeclaration |
upToAnnotationMethodDeclaration()
|
ClassDeclaration |
upToClassDeclaration()
|
ConstructorDeclaration |
upToConstructorDeclaration()
|
EnumDeclaration |
upToEnumDeclaration()
|
InterfaceDeclaration |
upToInterfaceDeclaration()
|
MethodDeclaration |
upToMethodDeclaration()
|
TypeDeclaration |
upToTypeDeclaration()
|
VariableDefinition |
upToVariableDefinition()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface lombok.ast.Node |
---|
getParent, getPosition |
Constructor Detail |
---|
public Modifiers()
Method Detail |
---|
public InterfaceDeclaration upToInterfaceDeclaration()
public TypeDeclaration upToTypeDeclaration()
public AnnotationDeclaration upToAnnotationDeclaration()
public ClassDeclaration upToClassDeclaration()
public MethodDeclaration upToMethodDeclaration()
public VariableDefinition upToVariableDefinition()
public EnumDeclaration upToEnumDeclaration()
public ConstructorDeclaration upToConstructorDeclaration()
public AnnotationMethodDeclaration upToAnnotationMethodDeclaration()
public RawListAccessor<Annotation,Modifiers> rawAnnotations()
public StrictListAccessor<Annotation,Modifiers> astAnnotations()
public RawListAccessor<KeywordModifier,Modifiers> rawKeywords()
public StrictListAccessor<KeywordModifier,Modifiers> astKeywords()
public List<Node> getChildren()
getChildren
in interface Node
public boolean replaceChild(Node original, Node replacement) throws AstException
Node
replaceChild
in interface Node
true
if child
was indeed a direct child of this node (it will have been replaced).
AstException
- If the replacement is of the wrong type and the location for the replacement does not allow off-type assignments,
which is true for those nodes that only have an astName()
method and not a rawName()
method.public boolean detach(Node child)
Node
detach
in interface Node
true
if child
was indeed a direct child of this node (it will have been detached).Node.unparent()
public void accept(AstVisitor visitor)
public Modifiers copy()
public int getExplicitModifierFlags()
Modifiers
works.
Only those keywords that are explicitly in the AST are reported; to also include implicit flags, such
as for example the idea that methods in interfaces are always public and abstract even if not marked as such,
use getEffectiveModifierFlags()
.
public int getEffectiveModifierFlags()
Modifiers
works. Also sets flags that are implicitly true due to the nature
of the node that the modifiers are attached to (for example, inner interfaces are implicitly static and thus if the Modifiers object is a child of
such a declaration, its static bit will be set. Similarly, method declarations in interfaces are abstract and public whether or not those keywords
have been applied to the node).
public boolean isPublic()
public boolean isProtected()
public boolean isPrivate()
public boolean isPackagePrivate()
public boolean isStatic()
public boolean isFinal()
public boolean isAbstract()
public boolean isTransient()
public boolean isEmpty()
public boolean isGenerated()
Node
true
if this node is generated (not actually present in the source).
isGenerated
in interface Node
public Node getGeneratedBy()
Node
null
if this node is not generated.
getGeneratedBy
in interface Node
public boolean hasParent()
hasParent
in interface Node
public boolean replace(Node replacement) throws AstException
Node
replace
in interface Node
true
if the node was indeed replaced. Replacement fails if this node has no parent.
AstException
- If the replacement is of the wrong type and the location for the replacement does not allow off-type assignments,
which is true for those nodes that only have an astName()
method and not a rawName()
method.public void unparent()
Node
unparent
in interface Node
Node.detach(Node)
protected lombok.ast.AbstractNode adopt(lombok.ast.AbstractNode child) throws IllegalStateException
child
- The node to adopt
child
parameter for chaining.
IllegalStateException
- If child
already has a parent (clone or unparent it first).protected void ensureParentless() throws IllegalStateException
IllegalStateException
- if I have a parent.protected void disown(lombok.ast.AbstractNode child) throws IllegalStateException
child
- Child node to disown
IllegalStateException
- if child
isn't a direct child of myself.protected void ensureParentage(lombok.ast.AbstractNode child) throws IllegalStateException
child
- This node must be a direct child of myself.
IllegalStateException
- If child
isn't a direct child of myself.public Node setPosition(Position position)
setPosition
in interface Node
public String toString()
toString
in interface Node
toString
in class Object
public Node addMessage(Message message)
addMessage
in interface Node
public boolean hasMessage(String key)
hasMessage
in interface Node
public List<Message> getMessages()
getMessages
in interface Node
|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |