APIdia Launch Partner
Top Inners Methods
jdk.javadoc.internal.doclets.toolkit

public Interface DocletElement

extends Element
Known Direct Implementers
jdk.javadoc.internal.doclets.toolkit.OverviewElement, jdk.javadoc.internal.doclets.toolkit.DocFileElement
Imports
javax.lang.model.element.AnnotationMirror, .Element, .ElementKind, .ElementVisitor, .Modifier, .Name, .PackageElement, javax.lang.model.type.TypeMirror, javax.tools.FileObject, java.lang.annotation.Annotation, java.util.List, .Set

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
DocletElement.Kind

Subkind enums that this element supports.

Method Summary

Modifier and TypeMethod and Description
public default <R, P> R
accept(ElementVisitor<R, P> v, P p)

Implements javax.lang.model.element.Element.accept.

Applies a visitor to this element.

public default TypeMirror
asType()

Implements javax.lang.model.element.Element.asType.

Returns the type defined by this element.

public default <A extends Annotation> A
getAnnotation(Class<A> annotationType)

Implements javax.lang.model.element.Element.getAnnotation.

Returns this construct's annotation of the specified type if such an annotation is present, else null.

public default List<? extends AnnotationMirror>
getAnnotationMirrors()

Implements javax.lang.model.element.Element.getAnnotationMirrors.

Returns the annotations that are directly present on this construct.

public default <A extends Annotation> A[]
getAnnotationsByType(Class<A> annotationType)

Implements javax.lang.model.element.Element.getAnnotationsByType.

Returns annotations of the specified type that are associated with this construct.

public default List<? extends Element>
getEnclosedElements()

Implements javax.lang.model.element.Element.getEnclosedElements.

Returns the elements that are, loosely speaking, directly enclosed by this element.

public default Element
getEnclosingElement()

Implements javax.lang.model.element.Element.getEnclosingElement.

Returns the innermost element within which this element is, loosely speaking, enclosed.

public FileObject

Returns:

the file object
getFileObject
()

Returns the file object associated with this special element such as overview.html, doc-files/foo.html.

public default ElementKind
getKind()

Implements javax.lang.model.element.Element.getKind.

Returns the kind of this element.

public default Set<Modifier>
getModifiers()

Implements javax.lang.model.element.Element.getModifiers.

Returns the modifiers of this element, excluding annotations.

public PackageElement

Returns:

the anchor element.
getPackageElement
()

Returns the anchoring package element, in the case of a module element, this is the module's unnamed package.

public default Name
getSimpleName()

Implements javax.lang.model.element.Element.getSimpleName.

Returns the simple (unqualified) name of this element.

public DocletElement.Kind

Returns:

a subkind
getSubKind
()

Returns the subkind of this element.

Inherited from javax.lang.model.element.Element:
equalshashCode

Method Detail

acceptback to summary
public default <R, P> R accept(ElementVisitor<R, P> v, P p)

Implements javax.lang.model.element.Element.accept.

Doc from javax.lang.model.element.Element.accept.

Applies a visitor to this element.

Annotations
@Override
asTypeback to summary
public default TypeMirror asType()

Implements javax.lang.model.element.Element.asType.

Doc from javax.lang.model.element.Element.asType.

Returns the type defined by this element.

Annotations
@Override
getAnnotationback to summary
public default <A extends Annotation> A getAnnotation(Class<A> annotationType)

Implements javax.lang.model.element.Element.getAnnotation.

Doc from javax.lang.model.element.Element.getAnnotation.

Returns this construct's annotation of the specified type if such an annotation is present, else null.

The annotation returned by this method could contain an element whose value is of type Class. This value cannot be returned directly: information necessary to locate and load a class (such as the class loader to use) is not available, and the class might not be loadable at all. Attempting to read a Class object by invoking the relevant method on the returned annotation will result in a MirroredTypeException, from which the corresponding TypeMirror may be extracted. Similarly, attempting to read a Class[]-valued element will result in a MirroredTypesException.

Note

This method is unlike others in this and related interfaces. It operates on runtime reflective information — representations of annotation interfaces currently loaded into the VM — rather than on the representations defined by and used throughout these interfaces. Consequently, calling methods on the returned annotation object can throw many of the exceptions that can be thrown when calling methods on an annotation object returned by core reflection. This method is intended for callers that are written to operate on a known, fixed set of annotation interfaces.

Note that any annotation returned by this method is a declaration annotation.

Annotations
@Override
getAnnotationMirrorsback to summary
public default List<? extends AnnotationMirror> getAnnotationMirrors()

Implements javax.lang.model.element.Element.getAnnotationMirrors.

Doc from javax.lang.model.element.Element.getAnnotationMirrors.

Returns the annotations that are directly present on this construct.

To get inherited annotations as well, use getAllAnnotationMirrors.

Note that any annotations returned by this method are declaration annotations.

Annotations
@Override
getAnnotationsByTypeback to summary
public default <A extends Annotation> A[] getAnnotationsByType(Class<A> annotationType)

Implements javax.lang.model.element.Element.getAnnotationsByType.

Doc from javax.lang.model.element.Element.getAnnotationsByType.

Returns annotations of the specified type that are associated with this construct. If there are no annotations of the specified type associated with this construct, the return value is an array of length 0. The order of annotations which are directly or indirectly present on a construct C is computed as if indirectly present annotations on C are directly present on C in place of their container annotation, in the order in which they appear in the value element of the container annotation. The difference between this method and getAnnotation(Class) is that this method detects if its argument is a repeatable annotation interface, and if so, attempts to find one or more annotations of that type by "looking through" a container annotation.

The annotations returned by this method could contain an element whose value is of type Class. This value cannot be returned directly: information necessary to locate and load a class (such as the class loader to use) is not available, and the class might not be loadable at all. Attempting to read a Class object by invoking the relevant method on the returned annotation will result in a MirroredTypeException, from which the corresponding TypeMirror may be extracted. Similarly, attempting to read a Class[]-valued element will result in a MirroredTypesException.

Note

This method is unlike others in this and related interfaces. It operates on runtime reflective information — representations of annotation interfaces currently loaded into the VM — rather than on the representations defined by and used throughout these interfaces. Consequently, calling methods on the returned annotation object can throw many of the exceptions that can be thrown when calling methods on an annotation object returned by core reflection. This method is intended for callers that are written to operate on a known, fixed set of annotation interfaces.

Note that any annotations returned by this method are declaration annotations.

Annotations
@Override
getEnclosedElementsback to summary
public default List<? extends Element> getEnclosedElements()

Implements javax.lang.model.element.Element.getEnclosedElements.

Doc from javax.lang.model.element.Element.getEnclosedElements.

Returns the elements that are, loosely speaking, directly enclosed by this element. A class or interface is considered to enclose the fields, methods, constructors, record components, and member classes and interfaces that it directly declares. A package encloses the top-level classes and interfaces within it, but is not considered to enclose subpackages. A module encloses packages within it. Enclosed elements may include implicitly declared mandated elements. Other kinds of elements are not currently considered to enclose any elements; however, that may change as this API or the programming language evolves.

Annotations
@Override
getEnclosingElementback to summary
public default Element getEnclosingElement()

Implements javax.lang.model.element.Element.getEnclosingElement.

Doc from javax.lang.model.element.Element.getEnclosingElement.

Returns the innermost element within which this element is, loosely speaking, enclosed.

Annotations
@Override
getFileObjectback to summary
public FileObject getFileObject()

Returns the file object associated with this special element such as overview.html, doc-files/foo.html.

Returns:FileObject

the file object

getKindback to summary
public default ElementKind getKind()

Implements javax.lang.model.element.Element.getKind.

Doc from javax.lang.model.element.Element.getKind.

Returns the kind of this element.

Annotations
@Override
getModifiersback to summary
public default Set<Modifier> getModifiers()

Implements javax.lang.model.element.Element.getModifiers.

Doc from javax.lang.model.element.Element.getModifiers.

Returns the modifiers of this element, excluding annotations. Implicit modifiers, such as the public and static modifiers of interface members (JLS section 9.3), are included.

Annotations
@Override
getPackageElementback to summary
public PackageElement getPackageElement()

Returns the anchoring package element, in the case of a module element, this is the module's unnamed package.

Returns:PackageElement

the anchor element.

getSimpleNameback to summary
public default Name getSimpleName()

Implements javax.lang.model.element.Element.getSimpleName.

Doc from javax.lang.model.element.Element.getSimpleName.

Returns the simple (unqualified) name of this element. The name of a generic class or interface does not include any reference to its formal type parameters. For example, the simple name of the type element representing java.util.Set<E> is "Set". If this element represents an unnamed package, an unnamed module or an unnamed variable, an empty name is returned. If it represents a constructor, the name "<init>" is returned. If it represents a static initializer, the name "<clinit>" is returned. If it represents an anonymous class or instance initializer, an empty name is returned.

Annotations
@Override
getSubKindback to summary
public DocletElement.Kind getSubKind()

Returns the subkind of this element.

Returns:DocletElement.Kind

a subkind

jdk.javadoc.internal.doclets.toolkit back to summary

public final Enum DocletElement.Kind

extends Enum<DocletElement.Kind>
Class Inheritance

Subkind enums that this element supports.

Field Summary

Modifier and TypeField and Description
public static final DocletElement.Kind
public static final DocletElement.Kind

Constructor Summary

AccessConstructor and Description
private
Kind()

Method Summary

Modifier and TypeMethod and Description
public static DocletElement.Kind
public static DocletElement.Kind[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

DOCFILEback to summary
public static final DocletElement.Kind DOCFILE
OVERVIEWback to summary
public static final DocletElement.Kind OVERVIEW

Constructor Detail

Kindback to summary
private Kind()

Method Detail

valueOfback to summary
public static DocletElement.Kind valueOf(String name)
valuesback to summary
public static DocletElement.Kind[] values()