| Package | Description | 
|---|---|
| javax.lang.model.element | Interfaces used to model elements of the Java programming language. | 
| javax.lang.model.type | Interfaces used to model Java programming language types. | 
| javax.lang.model.util | Utilities to assist in the processing of
 program elements and
 types. | 
| Modifier and Type | Method and Description | 
|---|---|
| TypeMirror | Element. asType()Returns the type defined by this element. | 
| TypeMirror | ExecutableElement. getReceiverType() | 
| TypeMirror | ExecutableElement. getReturnType()Returns the return type of this executable. | 
| TypeMirror | TypeElement. getSuperclass()Returns the direct superclass of this type element. | 
| Modifier and Type | Method and Description | 
|---|---|
| List<? extends TypeMirror> | TypeParameterElement. getBounds()Returns the bounds of this type parameter. | 
| List<? extends TypeMirror> | TypeElement. getInterfaces()Returns the interface types directly implemented by this class
 or extended by this interface. | 
| List<? extends TypeMirror> | ExecutableElement. getThrownTypes()Returns the exceptions and other throwables listed in this
 method or constructor's  throwsclause in declaration
 order. | 
| Modifier and Type | Method and Description | 
|---|---|
| R | AnnotationValueVisitor. visitType(TypeMirror t,
         P p)Visits a type value in an annotation. | 
| Modifier and Type | Interface and Description | 
|---|---|
| interface  | ArrayTypeRepresents an array type. | 
| interface  | DeclaredTypeRepresents a declared type, either a class type or an interface type. | 
| interface  | ErrorTypeRepresents a class or interface type that cannot be properly modeled. | 
| interface  | ExecutableTypeRepresents the type of an executable. | 
| interface  | IntersectionTypeRepresents an intersection type. | 
| interface  | NoTypeA pseudo-type used where no actual type is appropriate. | 
| interface  | NullTypeRepresents the null type. | 
| interface  | PrimitiveTypeRepresents a primitive type. | 
| interface  | ReferenceTypeRepresents a reference type. | 
| interface  | TypeVariableRepresents a type variable. | 
| interface  | UnionTypeRepresents a union type. | 
| interface  | WildcardTypeRepresents a wildcard type argument. | 
| Modifier and Type | Method and Description | 
|---|---|
| TypeMirror | ArrayType. getComponentType()Returns the component type of this array type. | 
| TypeMirror | DeclaredType. getEnclosingType()Returns the type of the innermost enclosing instance or a
  NoTypeof kindNONEif there is no enclosing
 instance. | 
| TypeMirror | WildcardType. getExtendsBound()Returns the upper bound of this wildcard. | 
| TypeMirror | TypeVariable. getLowerBound()Returns the lower bound of this type variable. | 
| TypeMirror | ExecutableType. getReceiverType() | 
| TypeMirror | ExecutableType. getReturnType()Returns the return type of this executable. | 
| TypeMirror | WildcardType. getSuperBound()Returns the lower bound of this wildcard. | 
| TypeMirror | MirroredTypeException. getTypeMirror()Returns the type mirror corresponding to the type being accessed. | 
| TypeMirror | UnknownTypeException. getUnknownType()Returns the unknown type. | 
| TypeMirror | TypeVariable. getUpperBound()Returns the upper bound of this type variable. | 
| Modifier and Type | Method and Description | 
|---|---|
| List<? extends TypeMirror> | UnionType. getAlternatives()Return the alternatives comprising this union type. | 
| List<? extends TypeMirror> | IntersectionType. getBounds()Return the bounds comprising this intersection type. | 
| List<? extends TypeMirror> | ExecutableType. getParameterTypes()Returns the types of this executable's formal parameters. | 
| List<? extends TypeMirror> | ExecutableType. getThrownTypes()Returns the exceptions and other throwables listed in this
 executable's  throwsclause. | 
| List<? extends TypeMirror> | DeclaredType. getTypeArguments()Returns the actual type arguments of this type. | 
| List<? extends TypeMirror> | MirroredTypesException. getTypeMirrors()Returns the type mirrors corresponding to the types being accessed. | 
| Modifier and Type | Method and Description | 
|---|---|
| R | TypeVisitor. visit(TypeMirror t)A convenience method equivalent to  v.visit(t, null). | 
| R | TypeVisitor. visit(TypeMirror t,
     P p)Visits a type. | 
| R | TypeVisitor. visitUnknown(TypeMirror t,
            P p)Visits an unknown kind of type. | 
| Constructor and Description | 
|---|
| MirroredTypeException(TypeMirror type)Constructs a new MirroredTypeException for the specified type. | 
| UnknownTypeException(TypeMirror t,
                    Object p)Creates a new  UnknownTypeException.Thepparameter may be used to pass in an additional argument with
 information about the context in which the unknown type was
 encountered; for example, the visit methods ofTypeVisitormay pass in their additional parameter. | 
| Constructor and Description | 
|---|
| MirroredTypesException(List<? extends TypeMirror> types)Constructs a new MirroredTypesException for the specified types. | 
| Modifier and Type | Method and Description | 
|---|---|
| TypeMirror | Types. asMemberOf(DeclaredType containing,
          Element element)Returns the type of an element when that element is viewed as
 a member of, or otherwise directly contained by, a given type. | 
| TypeMirror | Types. capture(TypeMirror t)Applies capture conversion to a type. | 
| TypeMirror | Types. erasure(TypeMirror t)Returns the erasure of a type. | 
| Modifier and Type | Method and Description | 
|---|---|
| List<? extends TypeMirror> | Types. directSupertypes(TypeMirror t)Returns the direct supertypes of a type. | 
| Modifier and Type | Method and Description | 
|---|---|
| Element | Types. asElement(TypeMirror t)Returns the element corresponding to a type. | 
| TypeMirror | Types. capture(TypeMirror t)Applies capture conversion to a type. | 
| boolean | Types. contains(TypeMirror t1,
        TypeMirror t2)Tests whether one type argument contains another. | 
| protected R | SimpleTypeVisitor6. defaultAction(TypeMirror e,
             P p)The default action for visit methods. | 
| List<? extends TypeMirror> | Types. directSupertypes(TypeMirror t)Returns the direct supertypes of a type. | 
| TypeMirror | Types. erasure(TypeMirror t)Returns the erasure of a type. | 
| ArrayType | Types. getArrayType(TypeMirror componentType)Returns an array type with the specified component type. | 
| 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. | 
| DeclaredType | Types. getDeclaredType(TypeElement typeElem,
               TypeMirror... typeArgs)Returns the type corresponding to a type element and
 actual type arguments. | 
| WildcardType | Types. getWildcardType(TypeMirror extendsBound,
               TypeMirror superBound)Returns a new wildcard type argument. | 
| boolean | Types. isAssignable(TypeMirror t1,
            TypeMirror t2)Tests whether one type is assignable to another. | 
| boolean | Types. isSameType(TypeMirror t1,
          TypeMirror t2)Tests whether two  TypeMirrorobjects represent the same type. | 
| boolean | Types. isSubtype(TypeMirror t1,
         TypeMirror t2)Tests whether one type is a subtype of another. | 
| PrimitiveType | Types. unboxedType(TypeMirror t)Returns the type (a primitive type) of unboxed values of a given type. | 
| R | AbstractTypeVisitor6. visit(TypeMirror t)Visits any type mirror as if by passing itself to that type
 mirror's  acceptmethod and passingnullfor the additional parameter. | 
| R | AbstractTypeVisitor6. visit(TypeMirror t,
     P p)Visits any type mirror as if by passing itself to that type
 mirror's  acceptmethod. | 
| R | SimpleAnnotationValueVisitor6. visitType(TypeMirror t,
         P p)Visits a type value in an annotation. | 
| R | AbstractTypeVisitor6. visitUnknown(TypeMirror t,
            P p)Visits an unknown kind of type. | 
 Submit a bug or feature 
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
 Copyright © 1993, 2025, Oracle and/or its affiliates.  All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.