Lombok.ast - v0.2

lombok.ast
Class VariableDefinition

java.lang.Object
  extended by lombok.ast.VariableDefinition
All Implemented Interfaces:
Node

public class VariableDefinition
extends Object


Constructor Summary
VariableDefinition()
           
 
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.
 Modifiers astModifiers()
           
 VariableDefinition astModifiers(Modifiers modifiers)
           
 TypeReference astTypeReference()
           
 VariableDefinition astTypeReference(TypeReference typeReference)
           
 boolean astVarargs()
           
 VariableDefinition astVarargs(boolean varargs)
           
 StrictListAccessor<VariableDefinitionEntry,VariableDefinition> astVariables()
           
 VariableDefinition 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()
           
 Node getGeneratedBy()
          Returns the node that is responsible for generating this node.
 List<Message> getMessages()
           
 boolean hasMessage(String key)
           
 boolean hasParent()
           
 boolean isGenerated()
          Returns true if this node is generated (not actually present in the source).
 Node rawTypeReference()
           
 VariableDefinition rawTypeReference(Node typeReference)
           
 RawListAccessor<VariableDefinitionEntry,VariableDefinition> rawVariables()
           
 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.
 ConstructorDeclaration upIfParameterToConstructorDeclaration()
           
 MethodDeclaration upIfParameterToMethodDeclaration()
           
 Catch upToCatch()
           
 For upToFor()
           
 ForEach upToForEach()
           
 VariableDeclaration upToVariableDeclaration()
           
 TypeDeclaration upUpIfFieldToTypeDeclaration()
           
 Block upUpIfLocalVariableToBlock()
           
 
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

VariableDefinition

public VariableDefinition()
Method Detail

upToCatch

public Catch upToCatch()

upIfParameterToConstructorDeclaration

public ConstructorDeclaration upIfParameterToConstructorDeclaration()

upIfParameterToMethodDeclaration

public MethodDeclaration upIfParameterToMethodDeclaration()

upToVariableDeclaration

public VariableDeclaration upToVariableDeclaration()

upToFor

public For upToFor()

upToForEach

public ForEach upToForEach()

astModifiers

public Modifiers astModifiers()

astModifiers

public VariableDefinition astModifiers(Modifiers modifiers)

astTypeReference

public TypeReference astTypeReference()

astTypeReference

public VariableDefinition astTypeReference(TypeReference typeReference)

rawTypeReference

public Node rawTypeReference()

rawTypeReference

public VariableDefinition rawTypeReference(Node typeReference)

astVarargs

public boolean astVarargs()

astVarargs

public VariableDefinition astVarargs(boolean varargs)

rawVariables

public RawListAccessor<VariableDefinitionEntry,VariableDefinition> rawVariables()

astVariables

public StrictListAccessor<VariableDefinitionEntry,VariableDefinition> astVariables()

getChildren

public List<Node> getChildren()
Specified by:
getChildren in interface Node

replaceChild

public boolean replaceChild(Node original,
                            Node replacement)
                     throws AstException
Description copied from interface: Node
If the provided child node is a child of this node, the child/parent link will be deleted. The replacement node, if it is non-null, will take its place, and a new child/parent link will be created between this node and the replacement.

Specified by:
replaceChild in interface Node
Returns:
true if child was indeed a direct child of this node (it will have been replaced).
Throws:
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.

detach

public boolean detach(Node child)
Description copied from interface: Node
If the provided child node is a child of this node, the child/parent link will be deleted. The child's parentage is set to unparented, and whichever property in this node is linking to the child is cleared. If child is not a child of this node, nothing happens.

Specified by:
detach in interface Node
Returns:
true if child was indeed a direct child of this node (it will have been detached).
See Also:
Node.unparent()

accept

public void accept(AstVisitor visitor)

copy

public VariableDefinition copy()

upUpIfFieldToTypeDeclaration

public TypeDeclaration upUpIfFieldToTypeDeclaration()

upUpIfLocalVariableToBlock

public Block upUpIfLocalVariableToBlock()

isGenerated

public boolean isGenerated()
Description copied from interface: Node
Returns true if this node is generated (not actually present in the source).

Specified by:
isGenerated in interface Node

getGeneratedBy

public Node getGeneratedBy()
Description copied from interface: Node
Returns the node that is responsible for generating this node. Returns null if this node is not generated.

Specified by:
getGeneratedBy in interface Node

hasParent

public boolean hasParent()
Specified by:
hasParent in interface Node

replace

public boolean replace(Node replacement)
                throws AstException
Description copied from interface: Node
Replaces this node with the replacement.

Specified by:
replace in interface Node
Returns:
true if the node was indeed replaced. Replacement fails if this node has no parent.
Throws:
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.

unparent

public void unparent()
Description copied from interface: Node
Severs the child/parent link between this node and its parent. This node's parentage will be set to unparented, and whichever property in the parent node is linking to this node is cleared. If this node is already unparented nothing happens.

Specified by:
unparent in interface Node
See Also:
Node.detach(Node)

adopt

protected lombok.ast.AbstractNode adopt(lombok.ast.AbstractNode child)
                                 throws IllegalStateException
Adopts (accepts as direct child) the provided node.

Parameters:
child - The node to adopt
Returns:
The child parameter for chaining.
Throws:
IllegalStateException - If child already has a parent (clone or unparent it first).

ensureParentless

protected void ensureParentless()
                         throws IllegalStateException
Checks if this node is currently parentless.

Throws:
IllegalStateException - if I have a parent.

disown

protected void disown(lombok.ast.AbstractNode child)
               throws IllegalStateException
Disowns a direct child (it will be parentless after this call).

Parameters:
child - Child node to disown
Throws:
IllegalStateException - if child isn't a direct child of myself.

ensureParentage

protected void ensureParentage(lombok.ast.AbstractNode child)
                        throws IllegalStateException
Checks if the provided node is a direct child of this node.

Parameters:
child - This node must be a direct child of myself.
Throws:
IllegalStateException - If child isn't a direct child of myself.

setPosition

public Node setPosition(Position position)
Specified by:
setPosition in interface Node

toString

public String toString()
Specified by:
toString in interface Node
Overrides:
toString in class Object

addMessage

public Node addMessage(Message message)
Specified by:
addMessage in interface Node

hasMessage

public boolean hasMessage(String key)
Specified by:
hasMessage in interface Node

getMessages

public List<Message> getMessages()
Specified by:
getMessages in interface Node

Lombok.ast - v0.2

Copyright © 2010-2011 The Project Lombok Authors, licensed under the MIT licence.