# Uses of Interface
javax.lang.model.element.TypeElement

Packages that use TypeElement
Package
Description
com.sun.source.tree
Provides interfaces to represent source code as abstract syntax trees (AST).
com.sun.source.util
Provides utilities for operations on abstract syntax trees (AST).
javax.annotation.processing
Facilities for declaring annotation processors and for allowing annotation processors to communicate with an annotation processing tool environment.
javax.lang.model.element
Interfaces used to model elements of the Java programming language.
javax.lang.model.util
Utilities to assist in the processing of program elements and types.
jdk.javadoc.doclet
The Doclet API provides an environment which, in conjunction with the Language Model API and Compiler Tree API, allows clients to inspect the source-level structures of programs and libraries, including API comments embedded in the source.

## Uses of TypeElement in com.sun.source.tree

Methods in com.sun.source.tree that return TypeElement
Modifier and Type
Method
Description
`TypeElement`
Scope.`getEnclosingClass()`
Returns the innermost type element containing the position of this scope.

## Uses of TypeElement in com.sun.source.util

Methods in com.sun.source.util that return TypeElement
Modifier and Type
Method
Description
`TypeElement`
TaskEvent.`getTypeElement()`
Returns the type element for this event.
Methods in com.sun.source.util with parameters of type TypeElement
Modifier and Type
Method
Description
`abstract ClassTree`
Trees.`getTree(TypeElement element)`
Returns the `ClassTree` node for a given `TypeElement`.
`abstract boolean`
Trees.`isAccessible(Scope scope, TypeElement type)`
Checks whether a given type is accessible in a given scope.
Constructors in com.sun.source.util with parameters of type TypeElement
Modifier
Constructor
Description
``
`TaskEvent(TaskEvent.Kind kind, CompilationUnitTree unit, TypeElement clazz)`
Creates a task event for a given kind, compilation unit and type element.

## Uses of TypeElement in javax.annotation.processing

Methods in javax.annotation.processing with parameters of type TypeElement
Modifier and Type
Method
Description
`Set<? extends Element>`
RoundEnvironment.`getElementsAnnotatedWith(TypeElement a)`
Returns the elements annotated with the given annotation interface.
`default Set<? extends Element>`
RoundEnvironment.`getElementsAnnotatedWithAny(TypeElement... annotations)`
Returns the elements annotated with one or more of the given annotation interfaces.
Method parameters in javax.annotation.processing with type arguments of type TypeElement
Modifier and Type
Method
Description
`boolean`
Processor.`process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv)`
Processes a set of annotation interfaces on root elements originating from the prior round and returns whether or not these annotation interfaces are claimed by this processor.

## Uses of TypeElement in javax.lang.model.element

Methods in javax.lang.model.element that return TypeElement
Modifier and Type
Method
Description
`TypeElement`
ModuleElement.ProvidesDirective.`getService()`
Returns the service being provided.
`TypeElement`
ModuleElement.UsesDirective.`getService()`
Returns the service that is used.
Methods in javax.lang.model.element that return types with arguments of type TypeElement
Modifier and Type
Method
Description
`List<? extends TypeElement>`
ModuleElement.ProvidesDirective.`getImplementations()`
Returns the implementations of the service being provided.
Methods in javax.lang.model.element with parameters of type TypeElement
Modifier and Type
Method
Description
`R`
ElementVisitor.`visitType(TypeElement e, P p)`
Visits a type element.

## Uses of TypeElement in javax.lang.model.util

Methods in javax.lang.model.util that return TypeElement
Modifier and Type
Method
Description
`TypeElement`
Types.`boxedClass(PrimitiveType p)`
Returns the class of a boxed value of the primitive type argument.
`default TypeElement`
Elements.`getOutermostTypeElement(Element e)`
Returns the outermost type element an element is contained in if such a containing element exists; otherwise returns `null`.
`TypeElement`
Elements.`getTypeElement(CharSequence name)`
Returns a type element given its canonical name if the type element is uniquely determinable in the environment.
`default TypeElement`
Elements.`getTypeElement(ModuleElement module, CharSequence name)`
Returns a type element given its canonical name, as seen from the given module.
Methods in javax.lang.model.util that return types with arguments of type TypeElement
Modifier and Type
Method
Description
`default Set<? extends TypeElement>`
Elements.`getAllTypeElements(CharSequence name)`
Returns all type elements with the given canonical name.
`static List<TypeElement>`
ElementFilter.`typesIn(Iterable<? extends Element> elements)`
Returns a list of classes and interfaces in `elements`.
`static Set<TypeElement>`
ElementFilter.`typesIn(Set<? extends Element> elements)`
Returns a set of types in `elements`.
Methods in javax.lang.model.util with parameters of type TypeElement
Modifier and Type
Method
Description
`List<? extends Element>`
Elements.`getAllMembers(TypeElement type)`
Returns all members of a type element, whether inherited or declared directly.
`Name`
Elements.`getBinaryName(TypeElement type)`
Returns the binary name of a type element.
`DeclaredType`
Types.`getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs)`
Returns the type corresponding to a type element and actual type arguments.
`DeclaredType`
Types.`getDeclaredType(DeclaredType containing, TypeElement typeElem, TypeMirror... typeArgs)`
Returns the type corresponding to a type element and actual type arguments, given a containing type of which it is a member.
`boolean`
Elements.`isFunctionalInterface(TypeElement type)`
Returns `true` if the type element is a functional interface, `false` otherwise.
`boolean`
Elements.`overrides(ExecutableElement overrider, ExecutableElement overridden, TypeElement type)`
Tests whether one method, as a member of a given class or interface, overrides another method.
`R`
ElementKindVisitor6.`visitType(TypeElement e, P p)`
Visits a type element.
`R`
ElementScanner14.`visitType(TypeElement e, P p)`
Visits a type element.
`R`
ElementScanner6.`visitType(TypeElement e, P p)`
Visits a type element.
`R`
SimpleElementVisitor6.`visitType(TypeElement e, P p)`
Visits a type element.
`R`
ElementKindVisitor6.`visitTypeAsAnnotationType(TypeElement e, P p)`
Visits an `ANNOTATION_TYPE` type element.
`R`
ElementKindVisitor6.`visitTypeAsClass(TypeElement e, P p)`
Visits a `CLASS` type element.
`R`
ElementKindVisitor6.`visitTypeAsEnum(TypeElement e, P p)`
Visits an `ENUM` type element.
`R`
ElementKindVisitor6.`visitTypeAsInterface(TypeElement e, P p)`
Visits an `INTERFACE` type element.
`R`
ElementKindVisitor14.`visitTypeAsRecord(TypeElement e, P p)`
Visits a `RECORD` type element.
`R`
ElementKindVisitor6.`visitTypeAsRecord(TypeElement e, P p)`
Visits a `RECORD` type element.

## Uses of TypeElement in jdk.javadoc.doclet

Methods in jdk.javadoc.doclet with parameters of type TypeElement
Modifier and Type
Method
Description
`JavaFileObject.Kind`
DocletEnvironment.`getFileKind(TypeElement type)`
Returns the file kind of a type element.