|
Eclipse JDT Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.jdt.core.dom.NodeFinder
public final class NodeFinder
For a given range, finds the covered node and the covering node.
Constructor Summary | |
---|---|
NodeFinder(ASTNode root,
int start,
int length)
Instantiate a new node finder using the given root node, the given start and the given length. |
Method Summary | |
---|---|
ASTNode |
getCoveredNode()
Returns the covered node. |
ASTNode |
getCoveringNode()
Returns the covering node. |
static ASTNode |
perform(ASTNode root,
int start,
int length)
Maps a selection to a given ASTNode, where the selection is defined using a start and a length. |
static ASTNode |
perform(ASTNode root,
int start,
int length,
ITypeRoot source)
Maps a selection to a given ASTNode, where the selection is given by a start and a length. |
static ASTNode |
perform(ASTNode root,
ISourceRange range)
Maps a selection to a given ASTNode, where the selection is defined using a source range. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NodeFinder(ASTNode root, int start, int length)
root
- the given root nodestart
- the given startlength
- the given lengthMethod Detail |
---|
public static ASTNode perform(ASTNode root, int start, int length)
start
and length
start
and length
is returned.start
.null
is returned.
root
- the root node from which the search startsstart
- the given startlength
- the given length
public static ASTNode perform(ASTNode root, ISourceRange range)
perform(root, range.getOffset(), range.getLength())
.
perform(ASTNode, int, int)
public static ASTNode perform(ASTNode root, int start, int length, ITypeRoot source) throws JavaModelException
start
and
length
where either start
and length
exactly
matches the node or where the text covered before and after the node only consists
of white spaces or comments.start
and length
is returned.start
.null
is returned.
root
- the root node from which the search startsstart
- the given startlength
- the given lengthsource
- the source of the compilation unit
JavaModelException
- if an error occurs in the Java modelpublic ASTNode getCoveredNode()
public ASTNode getCoveringNode()
|
Eclipse JDT Release 3.7 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) 2000, 2011 IBM Corporation and others. All rights reserved.