|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.netbeans.api.java.source.TreePathHandle
public final class TreePathHandle
Represents a handle for TreePath which can be kept and later resolved
by another javac. The Javac Elements are valid only in the single
CompilationTask or single run of the
CancellableTask. If the client needs to
keep a reference to the TreePath and use it in the other CancellableTask
he has to serialize it into the TreePathHandle.
Typical usage of TreePathHandle enclElIsCorrespondingEl:
final TreePathHandle[] tpHandle = new TreePathHandle[1]; javaSource.runCompileControlTask(new CancellableTask() { public void run(CompilationController compilationController) { parameter.toPhase(Phase.RESOLVED); CompilationUnitTree cu = compilationController.getTree (); TreePath treePath = getInterestingTreePath (cu); treePathHandle[0] = TreePathHandle.create (element, compilationController); } },priority); otherJavaSource.runCompileControlTask(new CancellableTask () { public void run(CompilationController compilationController) { parameter.toPhase(Phase.RESOLVED); TreePath treePath = treePathHanlde[0].resolve (compilationController); .... } },priority);
| Method Summary | |
|---|---|
static TreePathHandle |
create(Element element,
CompilationInfo info)
Factory method for creating TreePathHandle. |
static TreePathHandle |
create(TreePath treePath,
CompilationInfo info)
Factory method for creating TreePathHandle. |
boolean |
equals(Object obj)
|
FileObject |
getFileObject()
getter for FileObject from give TreePathHandle |
Tree.Kind |
getKind()
Returns the Tree.Kind of this TreePathHandle,
it returns the kind of the Tree from which the handle
was created. |
int |
hashCode()
|
TreePath |
resolve(CompilationInfo compilationInfo)
Resolves an TreePath from the TreePathHandle. |
Element |
resolveElement(CompilationInfo info)
Resolves an Element from the TreePathHandle. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
@CheckForNull public FileObject getFileObject()
null if not available
public TreePath resolve(CompilationInfo compilationInfo)
throws IllegalArgumentException
TreePath from the TreePathHandle.
compilationInfo - representing the CompilationTask
Element or null if the element does not exist on
the classpath/sourcepath of CompilationTask.
IllegalArgumentException - when this TreePathHandle is not created for a source
represented by the compilationInfo.public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic Element resolveElement(CompilationInfo info)
Element from the TreePathHandle.
compilationInfo - representing the CompilationTask
Element or null if the element does not exist on
the classpath/sourcepath of CompilationTask.public Tree.Kind getKind()
Tree.Kind of this TreePathHandle,
it returns the kind of the Tree from which the handle
was created.
Tree.Kind
public static TreePathHandle create(TreePath treePath,
CompilationInfo info)
throws IllegalArgumentException
TreePathHandle.
treePath - for which the TrePathHandle should be created.info -
TreePathHandle
IllegalArgumentException - if arguments are not supported
public static TreePathHandle create(Element element,
CompilationInfo info)
throws IllegalArgumentException
TreePathHandle.
element - for which the TrePathHandle should be created.info -
TreePathHandle
IllegalArgumentException - if arguments are not supportedpublic String toString()
toString in class Object
|
org.netbeans.modules.java.source 0.60.2 10 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||