|
Lombok.ast - v0.2 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlombok.ast.TypeReference
public class TypeReference
Constructor Summary | |
---|---|
TypeReference()
|
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()
|
TypeReference |
astArrayDimensions(int arrayDimensions)
|
StrictListAccessor<TypeReferencePart,TypeReference> |
astParts()
|
WildcardKind |
astWildcard()
|
TypeReference |
astWildcard(WildcardKind wildcard)
|
static TypeReference |
BOOLEAN()
|
static TypeReference |
BYTE()
|
static TypeReference |
CHAR()
|
TypeReference |
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). |
static TypeReference |
DOUBLE()
|
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. |
static TypeReference |
FLOAT()
|
static TypeReference |
fromName(String name)
|
List<Node> |
getChildren()
|
String |
getDescription()
A very short string that is particularly useful in describing this node. |
Node |
getGeneratedBy()
Returns the node that is responsible for generating this node. |
List<Message> |
getMessages()
|
StrictListAccessor<TypeReference,TypeReference> |
getTypeArguments()
|
String |
getTypeName()
|
boolean |
hasMessage(String key)
|
boolean |
hasParent()
|
boolean |
hasTypeArguments()
|
static TypeReference |
INT()
|
boolean |
isBoolean()
|
boolean |
isByte()
|
boolean |
isChar()
|
boolean |
isDouble()
|
boolean |
isFloat()
|
boolean |
isGenerated()
Returns true if this node is generated (not actually present in the source). |
boolean |
isInt()
|
boolean |
isLong()
|
boolean |
isPrimitive()
|
boolean |
isShort()
|
boolean |
isVoid()
|
static TypeReference |
LONG()
|
RawListAccessor<TypeReferencePart,TypeReference> |
rawParts()
|
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)
|
static TypeReference |
SHORT()
|
String |
toString()
|
void |
unparent()
Severs the child/parent link between this node and its parent. |
MethodDeclaration |
upIfReturnTypeToMethodDeclaration()
|
TypeReferencePart |
upIfTypeArgumentToTypeReferencePart()
|
TypeVariable |
upIfTypeVariableBoundToTypeVariable()
|
ClassLiteral |
upToClassLiteral()
|
static TypeReference |
VOID()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface lombok.ast.Node |
---|
addMessage, getGeneratedBy, getMessages, getParent, getPosition, hasMessage, hasParent, isGenerated, replace, setPosition, toString, unparent |
Constructor Detail |
---|
public TypeReference()
Method Detail |
---|
public TypeVariable upIfTypeVariableBoundToTypeVariable()
public TypeReferencePart upIfTypeArgumentToTypeReferencePart()
public MethodDeclaration upIfReturnTypeToMethodDeclaration()
public ClassLiteral upToClassLiteral()
public WildcardKind astWildcard()
public TypeReference astWildcard(WildcardKind wildcard)
public RawListAccessor<TypeReferencePart,TypeReference> rawParts()
public StrictListAccessor<TypeReferencePart,TypeReference> astParts()
public int astArrayDimensions()
public TypeReference astArrayDimensions(int arrayDimensions)
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)
accept
in interface Node
public TypeReference copy()
copy
in interface Node
public String getDescription()
DescribedNode
null
to indicate this particular instance has no useful name (usually, but not neccessarily, because it is not valid).
NB: This method should never throw an exception!
getDescription
in interface DescribedNode
public static TypeReference VOID()
public static TypeReference BOOLEAN()
public static TypeReference INT()
public static TypeReference LONG()
public static TypeReference SHORT()
public static TypeReference BYTE()
public static TypeReference CHAR()
public static TypeReference DOUBLE()
public static TypeReference FLOAT()
public static TypeReference fromName(String name)
public boolean isPrimitive()
public boolean isBoolean()
public boolean isInt()
public boolean isLong()
public boolean isShort()
public boolean isByte()
public boolean isChar()
public boolean isDouble()
public boolean isFloat()
public boolean isVoid()
public String getTypeName()
public boolean hasTypeArguments()
public StrictListAccessor<TypeReference,TypeReference> getTypeArguments()
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 |