JavaHT TreePathHandle


As was mentioned above, it is not possible to hold Elements, TypeMirrors and Trees and to compare instances got from different javac instances.

To solve this limitation, ElementHandle and TreePathHandlewas introduced. The TreePathHandle allows to pass an TreePath from one javac instance to another. In the first instance of javac, create the handle using TreePathHandle.create(Element, CompilationInfo) method. Keep the resulting handle, but do not hold the tree or tree path itself. In the other instance of javac, use TreePathHandle.resolve(CompilationInfo) method to resolve the TreePathHandle back to the TreePath.

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo