< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/Elements.java

Print this page

        

*** 57,72 **** PackageElement getPackageElement(CharSequence name); /** * Returns a package given its fully qualified name, as seen from the given module. * * @param name fully qualified package name, or an empty string for an unnamed package * @param module module relative to which the lookup should happen * @return the specified package, or {@code null} if it cannot be found * @since 9 */ ! PackageElement getPackageElement(ModuleElement module, CharSequence name); /** * Returns a type element given its canonical name if the type element is unique in the environment. * If running with modules, all modules in the modules graph are searched for matching * type elements. --- 57,77 ---- PackageElement getPackageElement(CharSequence name); /** * Returns a package given its fully qualified name, as seen from the given module. * + * @implSpec The default implementation of this method returns + * {@code null}. + * * @param name fully qualified package name, or an empty string for an unnamed package * @param module module relative to which the lookup should happen * @return the specified package, or {@code null} if it cannot be found * @since 9 */ ! default PackageElement getPackageElement(ModuleElement module, CharSequence name) { ! return null; ! } /** * Returns a type element given its canonical name if the type element is unique in the environment. * If running with modules, all modules in the modules graph are searched for matching * type elements.
*** 77,107 **** TypeElement getTypeElement(CharSequence name); /** * Returns a type element given its canonical name, as seen from the given module. * * @param name the canonical name * @param module module relative to which the lookup should happen * @return the named type element, or {@code null} if it cannot be found * @since 9 */ ! TypeElement getTypeElement(ModuleElement module, CharSequence name); /** * Returns a module element given its fully qualified name. * If the named module cannot be found, null is returned. One situation where a module * cannot be found is if the environment does not include modules, such as * an annotation processing environment configured for * a {@linkplain * javax.annotation.processing.ProcessingEnvironment#getSourceVersion * source version} without modules. * * @param name the name * @return the named module element, or {@code null} if it cannot be found * @since 9 */ ! ModuleElement getModuleElement(CharSequence name); /** * Returns the values of an annotation's elements, including defaults. * * @see AnnotationMirror#getElementValues() --- 82,122 ---- TypeElement getTypeElement(CharSequence name); /** * Returns a type element given its canonical name, as seen from the given module. * + * @implSpec The default implementation of this method returns + * {@code null}. + * * @param name the canonical name * @param module module relative to which the lookup should happen * @return the named type element, or {@code null} if it cannot be found * @since 9 */ ! default TypeElement getTypeElement(ModuleElement module, CharSequence name) { ! return null; ! } /** * Returns a module element given its fully qualified name. * If the named module cannot be found, null is returned. One situation where a module * cannot be found is if the environment does not include modules, such as * an annotation processing environment configured for * a {@linkplain * javax.annotation.processing.ProcessingEnvironment#getSourceVersion * source version} without modules. * + * @implSpec The default implementation of this method returns + * {@code null}. + * * @param name the name * @return the named module element, or {@code null} if it cannot be found * @since 9 */ ! default ModuleElement getModuleElement(CharSequence name) { ! return null; ! } /** * Returns the values of an annotation's elements, including defaults. * * @see AnnotationMirror#getElementValues()
*** 335,349 **** * an annotation processing environment configured for * a {@linkplain * javax.annotation.processing.ProcessingEnvironment#getSourceVersion * source version} without modules. * * @param type the element being examined * @return the module of an element * @since 9 */ ! ModuleElement getModuleOf(Element type); /** * Returns all members of a type element, whether inherited or * declared directly. For a class the result also includes its * constructors, but not local or anonymous classes. --- 350,369 ---- * an annotation processing environment configured for * a {@linkplain * javax.annotation.processing.ProcessingEnvironment#getSourceVersion * source version} without modules. * + * @implSpec The default implementation of this method returns + * {@code null}. + * * @param type the element being examined * @return the module of an element * @since 9 */ ! default ModuleElement getModuleOf(Element type) { ! return null; ! } /** * Returns all members of a type element, whether inherited or * declared directly. For a class the result also includes its * constructors, but not local or anonymous classes.
< prev index next >