public abstract class Node extends Object implements Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
ABSOLUTE_BEGIN_LINE |
static int |
ABSOLUTE_END_LINE |
Constructor and Description |
---|
Node() |
Node(int beginLine,
int beginColumn,
int endLine,
int endColumn)
Deprecated.
prefer using Range objects.
|
Node(Range range) |
Modifier and Type | Method and Description |
---|---|
abstract <R,A> R |
accept(GenericVisitor<R,A> v,
A arg)
Accept method for visitor support.
|
abstract <A> void |
accept(VoidVisitor<A> v,
A arg)
Accept method for visitor support.
|
void |
addOrphanComment(Comment comment) |
Node |
clone() |
boolean |
contains(Node other) |
boolean |
equals(Object obj) |
List<Comment> |
getAllContainedComments()
This is the list of Comment which are contained in the Node either because
they are properly associated to one of its children or because they are floating
around inside the Node
|
Position |
getBegin()
The begin position of this node in the source file.
|
int |
getBeginColumn()
Deprecated.
prefer using Range objects.
|
int |
getBeginLine()
Deprecated.
prefer using Range objects.
|
List<Node> |
getChildrenNodes() |
Comment |
getComment()
This is a comment associated with this node.
|
Object |
getData()
Use this to retrieve additional information associated to this node.
|
Position |
getEnd()
The end position of this node in the source file.
|
int |
getEndColumn()
Deprecated.
prefer using Range objects.
|
int |
getEndLine()
Deprecated.
prefer using Range objects.
|
List<Comment> |
getOrphanComments()
This is a list of Comment which are inside the node and are not associated
with any meaningful AST Node.
|
Node |
getParentNode() |
Range |
getRange() |
boolean |
hasComment() |
int |
hashCode() |
boolean |
isPositionedAfter(int line,
int column)
Deprecated.
prefer using Range objects.
|
boolean |
isPositionedAfter(Position position) |
boolean |
isPositionedBefore(int line,
int column)
Deprecated.
prefer using Range objects.
|
boolean |
isPositionedBefore(Position position) |
protected void |
setAsParentNodeOf(List<? extends Node> childNodes) |
protected void |
setAsParentNodeOf(Node childNode) |
void |
setBegin(Position begin)
Sets the begin position of this node in the source file.
|
void |
setBeginColumn(int beginColumn)
Deprecated.
prefer using Range objects.
|
void |
setBeginLine(int beginLine)
Deprecated.
prefer using Range objects.
|
void |
setComment(Comment comment)
Use this to store additional information to this node.
|
void |
setData(Object data)
Use this to store additional information to this node.
|
void |
setEnd(Position end)
Sets the end position of this node in the source file.
|
void |
setEndColumn(int endColumn)
Deprecated.
prefer using Range objects.
|
void |
setEndLine(int endLine)
Deprecated.
prefer using Range objects.
|
void |
setParentNode(Node parentNode)
Assign a new parent to this node, removing it
from the list of children of the previous parent, if any.
|
void |
setRange(Range range) |
String |
toString()
Return the String representation of this node.
|
String |
toStringWithoutComments() |
public static final int ABSOLUTE_BEGIN_LINE
public static final int ABSOLUTE_END_LINE
public Node()
@Deprecated public Node(int beginLine, int beginColumn, int endLine, int endColumn)
public Node(Range range)
public abstract <R,A> R accept(GenericVisitor<R,A> v, A arg)
R
- the type the return value of the visitorA
- the type the argument passed to the visitorv
- the visitor implementationarg
- the argument passed to the visitorpublic abstract <A> void accept(VoidVisitor<A> v, A arg)
A
- the type the argument passed for the visitorv
- the visitor implementationarg
- any value relevant for the visitor@Deprecated public final int getBeginColumn()
@Deprecated public final int getBeginLine()
public final Comment getComment()
public final Object getData()
@Deprecated public final int getEndColumn()
@Deprecated public final int getEndLine()
@Deprecated public final void setBeginColumn(int beginColumn)
beginColumn
- the begin column of this node@Deprecated public final void setBeginLine(int beginLine)
beginLine
- the begin line of this nodepublic Position getBegin()
public Position getEnd()
public void setBegin(Position begin)
public void setEnd(Position end)
public Range getRange()
public void setRange(Range range)
range
- the range of characters in the source code that this node covers.public final void setComment(Comment comment)
comment
- to be setpublic final void setData(Object data)
data
- to be set@Deprecated public final void setEndColumn(int endColumn)
endColumn
- the end column of this node@Deprecated public final void setEndLine(int endLine)
endLine
- the end line of this nodepublic final String toString()
public final String toStringWithoutComments()
public Node getParentNode()
public boolean contains(Node other)
public void addOrphanComment(Comment comment)
public List<Comment> getOrphanComments()
public List<Comment> getAllContainedComments()
public void setParentNode(Node parentNode)
parentNode
- node to be set as parentprotected void setAsParentNodeOf(Node childNode)
@Deprecated public boolean isPositionedAfter(int line, int column)
public boolean isPositionedAfter(Position position)
@Deprecated public boolean isPositionedBefore(int line, int column)
public boolean isPositionedBefore(Position position)
public boolean hasComment()
Copyright © 2007–2016. All rights reserved.