Lombok.ast - v0.2

lombok.ast
Class VariableDefinitionEntry

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

public class VariableDefinitionEntry
extends Object


Constructor Summary
VariableDefinitionEntry()
           
 
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.
 int astArrayDimensions()
           
 VariableDefinitionEntry astArrayDimensions(int arrayDimensions)
           
 Expression astInitializer()
           
 VariableDefinitionEntry astInitializer(Expression initializer)
           
 Identifier astName()
           
 VariableDefinitionEntry astName(Identifier name)
           
 VariableDefinitionEntry 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()
           
 TypeReference getEffectiveTypeReference()
           
 Node getGeneratedBy()
          Returns the node that is responsible for generating this node.
 List<Message> getMessages()
           
 Modifiers getModifiersOfParent()
           
 boolean hasMessage(String key)
           
 boolean hasParent()
           
 boolean isGenerated()
          Returns true if this node is generated (not actually present in the source).
 Node rawInitializer()
           
 VariableDefinitionEntry rawInitializer(Node initializer)
           
 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.
 VariableDefinition upToVariableDefinition()
           
 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

VariableDefinitionEntry

public VariableDefinitionEntry()
Method Detail

upToVariableDefinition

public VariableDefinition upToVariableDefinition()

astName

public Identifier astName()

astName

public VariableDefinitionEntry astName(Identifier name)

astArrayDimensions

public int astArrayDimensions()

astArrayDimensions

public VariableDefinitionEntry astArrayDimensions(int arrayDimensions)

astInitializer

public Expression astInitializer()

astInitializer

public VariableDefinitionEntry astInitializer(Expression initializer)

rawInitializer

public Node rawInitializer()

rawInitializer

public VariableDefinitionEntry rawInitializer(Node initializer)

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 VariableDefinitionEntry copy()

getEffectiveTypeReference

public TypeReference getEffectiveTypeReference()

getModifiersOfParent

public Modifiers getModifiersOfParent()

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.