void
'. Executable types and the pseudo-types for
packages and modules are generally out of scope for these
methods. One or more out of scope arguments will typically result
in a method throwing an IllegalArgumentException
.
Where a method returns a type mirror or a collection of type mirrors, any type mirrors represent types with no type annotations, unless otherwise indicated.
Compatibility Note: Methods may be added to this interface in future releases of the platform.
javax.annotation.processing.ProcessingEnvironment#getTypeUtils
Modifier and Type | Method and Description |
---|---|
public Element | Returns: the element corresponding to the given typethe type to map to an element t)Returns the element corresponding to a type. |
public TypeMirror | Returns: the type of the element as viewed from the containing typethe containing type containing, Element the 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. |
public TypeElement | Returns: the class of a boxed value of the primitive type argumentthe primitive type to be converted p)Returns the class of a boxed value of the primitive type argument. |
public TypeMirror | Returns: the result of applying capture conversionthe type to be converted t)Applies capture conversion to a type. |
public boolean | Returns: true if and only if the first type contains the secondthe first type t1, TypeMirror the second type t2)Tests whether one type argument contains another. |
public List | Returns: the direct supertypes, or an empty list if nonethe type being examined t)Returns the direct supertypes of a type. |
public TypeMirror | Returns: the erasure of a typethe type to be erased t)Returns the erasure of a type. |
public ArrayType | Returns: an array type with the specified component typethe component type componentType)Returns an array type with the specified component type. |
public DeclaredType | Returns: the type corresponding to a type element and actual type argumentsthe type element typeElem, TypeMirror... the actual type arguments typeArgs)Returns the type corresponding to a type element and actual type arguments. |
public DeclaredType | Returns: the type corresponding to the type element and actual type arguments, contained within the given typethe containing type, or containing, TypeElement null if nonethe type element typeElem, TypeMirror... the actual type arguments typeArgs)Returns the type corresponding to a type element and actual type arguments, given a containing type of which it is a member. |
public NoType | |
public NullType | |
public PrimitiveType | Returns: a primitive typethe kind of primitive type to return kind)Returns a primitive type. |
public WildcardType | Returns: a new wildcard typethe extends (upper) bound, or extendsBound, TypeMirror null if nonethe super (lower) bound, or superBound)null if noneReturns a new wildcard type. |
public boolean | Returns: true if and only if the first type is assignable
to the secondthe first type t1, TypeMirror the second type t2)Tests whether one type is assignable to another. |
public boolean | Returns: true if and only if the two types are the samethe first type t1, TypeMirror the second type t2)Tests whether two |
public boolean | Returns: true if and only if the first signature is a
subsignature of the secondthe first method m1, ExecutableType the second method m2)Tests whether the signature of one method is a subsignature of another. |
public boolean | Returns: true if and only if the first type is a subtype
of the secondthe first type t1, TypeMirror the second type t2)Tests whether one type is a subtype of another. |
public default < the specific type of type mirror T extends TypeMirror> T | Returns: a type mirror equivalent to the argument, but with no annotationsthe type mirror t)Returns a type mirror equivalent to the argument, but with no annotations. |
public PrimitiveType | Returns: the type of an unboxed value of typet the type to be unboxed t)Returns the type (a primitive type) of unboxed values of a given type. |
asElement | back to summary |
---|---|
public Element asElement(TypeMirror t) Returns the element corresponding to a type. The type may be one of:
null if the type is not one with a
corresponding element.
Types without corresponding elements include:
|
asMemberOf | back to summary |
---|---|
public TypeMirror 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.
For example,
when viewed as a member of the parameterized type
|
boxedClass | back to summary |
---|---|
public TypeElement boxedClass(PrimitiveType p) Returns the class of a boxed value of the primitive type argument. That is, boxing conversion is applied.
|
capture | back to summary |
---|---|
public TypeMirror capture(TypeMirror t) Applies capture conversion to a type.
|
contains | back to summary |
---|---|
public boolean contains(TypeMirror t1, TypeMirror t2) Tests whether one type argument contains another.
|
directSupertypes | back to summary |
---|---|
public List Returns the direct supertypes of a type. The interface types, if any,
will appear last in the list. For an interface type with no direct
super-interfaces, a type mirror representing
|
erasure | back to summary |
---|---|
public TypeMirror erasure(TypeMirror t) Returns the erasure of a type.
|
getArrayType | back to summary |
---|---|
public ArrayType getArrayType(TypeMirror componentType) Returns an array type with the specified component type. Annotations on the component type are preserved.
|
getDeclaredType | back to summary |
---|---|
public DeclaredType getDeclaredType(TypeElement typeElem, TypeMirror... typeArgs) Returns the type corresponding to a type element and
actual type arguments.
Given the type element for The number of type arguments must either equal the number of the type element's formal type parameters, or must be zero. If zero, and if the type element is generic, then the type element's raw type is returned. If a parameterized type is being returned, its type element
must not be contained within a generic outer class.
The parameterized type
|
getDeclaredType | back to summary |
---|---|
public DeclaredType 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.
The parameterized type If the containing type is a parameterized type,
the number of type arguments must equal the
number of
|
getNoType | back to summary |
---|---|
public NoType getNoType(TypeKind kind) Returns a pseudo-type used where no actual type is appropriate.
The kind of type to return may be either
To get the pseudo-type corresponding to a package or module,
call
|
getNullType | back to summary |
---|---|
public NullType getNullType() Returns the null type. This is the type of
|
getPrimitiveType | back to summary |
---|---|
public PrimitiveType getPrimitiveType(TypeKind kind) Returns a primitive type.
|
getWildcardType | back to summary |
---|---|
public WildcardType getWildcardType(TypeMirror extendsBound, TypeMirror superBound) Returns a new wildcard type. Either of the wildcard's bounds may be specified, or neither, but not both. Annotations on the bounds are preserved.
|
isAssignable | back to summary |
---|---|
public boolean isAssignable(TypeMirror t1, TypeMirror t2) Tests whether one type is assignable to another.
|
isSameType | back to summary |
---|---|
public boolean isSameType(TypeMirror t1, TypeMirror t2) Tests whether two Caveat if either of the arguments to this method represents a wildcard, this method will return false. As a consequence, a wildcard is not the same type as itself. This might be surprising at first, but makes sense once you consider that an example like this must be rejected by the compiler:
Since annotations are only meta-data associated with a type,
the set of annotations on either argument is not taken
into account when computing whether or not two
|
isSubsignature | back to summary |
---|---|
public boolean isSubsignature(ExecutableType m1, ExecutableType m2) Tests whether the signature of one method is a subsignature of another.
|
isSubtype | back to summary |
---|---|
public boolean isSubtype(TypeMirror t1, TypeMirror t2) Tests whether one type is a subtype of another. Any type is considered to be a subtype of itself.
|
stripAnnotations | back to summary |
---|---|
public default <T extends TypeMirror> T stripAnnotations(T t) Returns a type mirror equivalent to the argument, but with no annotations. If the type mirror is a composite type, such as an array type or a wildcard type, any constitute types, such as the component type of an array and the type of the bounds of a wildcard type, also have no annotations, recursively. For most kinds of type mirrors, the result of types.isSameType(typeMirror, types.stripAnnotations(typeMirror)) true . The predicate is false on wildcard
types for reasons discussed elsewhere.
Implementation Specification The default implementation throws
|
unboxedType | back to summary |
---|---|
public PrimitiveType unboxedType(TypeMirror t) Returns the type (a primitive type) of unboxed values of a given type. That is, unboxing conversion is applied.
|