There is no easy way to get from an Element (TypeElement, PackageElement, ModuleElement) to the JavaFileObject for the source or class from which it was read.
It would be good to add
JavaFileObject Elements.getJavaFileObject(Element e)
that returns the information if available, null if not, and IllegalArgumentException if not (type, package, module)
It would be good to add
JavaFileObject Elements.getJavaFileObject(Element e)
that returns the information if available, null if not, and IllegalArgumentException if not (type, package, module)
- duplicates
-
JDK-8224922 Access JavaFileObject from Element(s)
- Resolved
- relates to
-
JDK-8255408 Provide access to JavaFileObject(s) for an Element
- Closed