public static class Type.AnnotatedType extends Type implements ArrayType, DeclaredType, PrimitiveType, TypeVariable, WildcardType
Type.AnnotatedType, Type.ArrayType, Type.CapturedType, Type.CapturedUndetVar, Type.ClassType, Type.DelegatedType, Type.ErasedClassType, Type.ErrorType, Type.ForAll, Type.IntersectionClassType, Type.JCNoType, Type.JCPrimitiveType, Type.JCVoidType, Type.Mapping, Type.MethodType, Type.PackageType, Type.TypeVar, Type.UndetVar, Type.UnionClassType, Type.UnknownType, Type.Visitor<R,S>, Type.WildcardType
Modifier | Constructor and Description |
---|---|
protected |
AnnotatedType(List<Attribute.TypeCompound> typeAnnotations,
Type underlyingType) |
Modifier and Type | Method and Description |
---|---|
<R,S> R |
accept(Type.Visitor<R,S> v,
S s) |
<R,P> R |
accept(TypeVisitor<R,P> v,
P p)
Applies a visitor to this type.
|
List<Type> |
allparams()
Return all parameters of this type and all its outer types in order
outer (first) to inner (last).
|
Symbol.TypeSymbol |
asElement()
Returns the element corresponding to this type.
|
Type.MethodType |
asMethodType()
The underlying method type of this type.
|
void |
complete()
Complete loading all classes in this type.
|
Type |
constType(Object constValue)
Define a constant type, of the same kind as this type
and with given constant value
|
boolean |
contains(Type t)
Does this type contain occurrences of type t?
|
List<Attribute.TypeCompound> |
getAnnotationMirrors()
Returns the annotations that are directly present on
this construct.
|
TypeMirror |
getComponentType()
Returns the component type of this array type.
|
Type |
getEnclosingType()
Returns the type of the innermost enclosing instance or a
NoType of kind NONE if there is no enclosing
instance. |
TypeMirror |
getExtendsBound()
Returns the upper bound of this wildcard.
|
TypeKind |
getKind()
Returns the
kind of this type. |
Type |
getLowerBound()
Returns the lower bound of this type variable.
|
List<Type> |
getParameterTypes() |
Type |
getReceiverType() |
Type |
getReturnType() |
TypeMirror |
getSuperBound()
Returns the lower bound of this wildcard.
|
TypeTag |
getTag()
Returns the current type tag.
|
List<Type> |
getThrownTypes() |
List<Type> |
getTypeArguments()
Access methods.
|
Type |
getUpperBound()
Returns the upper bound of this type variable.
|
boolean |
isAnnotated() |
boolean |
isCompound() |
boolean |
isErroneous()
Does this type contain "error" elements?
|
boolean |
isExtendsBound() |
boolean |
isFinal() |
boolean |
isInterface() |
boolean |
isNullOrReference() |
boolean |
isNumeric() |
boolean |
isParameterized()
Is this type parameterized?
A class type is parameterized if it has some parameters.
|
boolean |
isPartial() |
boolean |
isPrimitive() |
boolean |
isPrimitiveOrVoid() |
boolean |
isRaw()
Is this type a raw type?
A class type is a raw type if it misses some of its parameters.
|
boolean |
isReference() |
boolean |
isSuperBound() |
boolean |
isUnbound() |
Type |
makeVarargs() |
Type |
map(Type.Mapping f)
map a type function over all immediate descendants of this type
|
String |
toString()
The Java source which this type represents.
|
Type |
unannotatedType()
If this is an annotated type, return the underlying type.
|
Type |
withTypeVar(Type t) |
annotatedType, argtypes, baseType, baseTypes, constValue, contains, containsAny, containsAny, equals, filter, getAnnotation, getAnnotationsByType, getModelType, getModelTypes, getOriginalType, hashCode, hasTag, isErroneous, isFalse, isTrue, map, stringValue, toString
getAttribute, getInheritedAnnotations
protected AnnotatedType(List<Attribute.TypeCompound> typeAnnotations, Type underlyingType)
public boolean isAnnotated()
isAnnotated
in class Type
public List<Attribute.TypeCompound> getAnnotationMirrors()
AnnotatedConstruct
getAnnotationMirrors
in interface AnnotatedConstruct
getAnnotationMirrors
in class Type
public TypeKind getKind()
TypeMirror
kind
of this type.getKind
in interface TypeMirror
getKind
in class Type
public Type unannotatedType()
Type
unannotatedType
in class Type
public <R,S> R accept(Type.Visitor<R,S> v, S s)
public <R,P> R accept(TypeVisitor<R,P> v, P p)
TypeMirror
accept
in interface TypeMirror
accept
in class Type
R
- the return type of the visitor's methodsP
- the type of the additional parameter to the visitor's methodsv
- the visitor operating on this typep
- additional parameter to the visitorpublic Type map(Type.Mapping f)
Type
public Type constType(Object constValue)
Type
public Type getEnclosingType()
DeclaredType
NoType
of kind NONE
if there is no enclosing
instance. Only types corresponding to inner classes have an
enclosing instance.getEnclosingType
in interface DeclaredType
getEnclosingType
in class Type
public Type getReturnType()
getReturnType
in class Type
public List<Type> getTypeArguments()
Type
getTypeArguments
in interface DeclaredType
getTypeArguments
in class Type
public List<Type> getParameterTypes()
getParameterTypes
in class Type
public Type getReceiverType()
getReceiverType
in class Type
public List<Type> getThrownTypes()
getThrownTypes
in class Type
public Type getUpperBound()
TypeVariable
If this type variable was declared with no explicit
upper bounds, the result is java.lang.Object
.
If it was declared with multiple upper bounds,
the result is an intersection type;
individual bounds can be found by examining the result's
bounds.
getUpperBound
in interface TypeVariable
getUpperBound
in class Type
public Type getLowerBound()
TypeVariable
NullType
.getLowerBound
in interface TypeVariable
getLowerBound
in class Type
public boolean isErroneous()
Type
isErroneous
in class Type
public boolean isCompound()
isCompound
in class Type
public boolean isInterface()
isInterface
in class Type
public List<Type> allparams()
Type
public boolean isPrimitive()
isPrimitive
in class Type
public boolean isPrimitiveOrVoid()
isPrimitiveOrVoid
in class Type
public boolean isReference()
isReference
in class Type
public boolean isNullOrReference()
isNullOrReference
in class Type
public boolean isParameterized()
Type
isParameterized
in class Type
public boolean isRaw()
Type
public boolean isSuperBound()
isSuperBound
in class Type
public boolean isExtendsBound()
isExtendsBound
in class Type
public String toString()
Type
toString
in interface TypeMirror
toString
in class Type
public boolean contains(Type t)
Type
public Type withTypeVar(Type t)
withTypeVar
in class Type
public Symbol.TypeSymbol asElement()
DeclaredType
asElement
in interface DeclaredType
asElement
in interface TypeVariable
asElement
in class Type
public Type.MethodType asMethodType()
Type
asMethodType
in class Type
public void complete()
Type
public TypeMirror getComponentType()
ArrayType
getComponentType
in interface ArrayType
public Type makeVarargs()
public TypeMirror getExtendsBound()
WildcardType
null
is returned.getExtendsBound
in interface WildcardType
public TypeMirror getSuperBound()
WildcardType
null
is returned.getSuperBound
in interface WildcardType
Copyright © 2015. All rights reserved.