A type usage may have annotations associated with its declaration. A type is equal to another type if, and only if, it represents the same exact definition including the annotations specific to its usage.
To reduce memory overhead, type instances are often shared between their enclosing classes.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv abstract static class | |
| public static enum | Type.Kind
Represents a "kind" of Type. |
| Modifier and Type | Field and Description |
|---|---|
| private final AnnotationInstance[] | |
| private static final AnnotationInstance[] | |
| public static final Type[] | |
| private final DotName |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv Type | |
| public final AnnotationInstance | Returns: the annotation instance, ornull if not foundname of the annotation type to look for, must not be name)nullReturns the annotation instance with given name declared on this type usage. |
| pack-priv AnnotationInstance[] | |
| public List | Returns: immutable list of annotation instances, nevernullReturns the annotation instances declared on this type usage. |
| public final List | Returns: immutable list of annotation instances, nevernullname of the annotation type, must not be name, IndexView nullindex used to obtain the annotation type, must not be index)nullReturns the annotation instances with given name declared on this type usage. |
| pack-priv void | |
| public ArrayType | Returns: anArrayTypeCasts this type to an |
| public ClassType | Returns: aClassTypeCasts this type to a |
| public ParameterizedType | Returns: aParameterizedTypeCasts this type to a |
| public PrimitiveType | Returns: aPrimitiveTypeCasts this type to a |
| public TypeVariable | Returns: aTypeVariableCasts this type to a |
| public TypeVariableReference | Returns: aTypeVariableReferenceCasts this type to a |
| public UnresolvedTypeVariable | Returns: anUnresolvedTypeVariableCasts this type to an |
| public VoidType | Returns: aVoidTypeCasts this type to a |
| public WildcardType | Returns: aWildcardTypeCasts this type to a |
| pack-priv abstract Type | |
| public static Type | Returns: the typethe name of type to use or parse; must not be name, Type.nullthe kind of type to create; must not be kindnullCreates a type of the specified kind and |
| public static Type | Returns: the annotated typethe name of type to use or parse; must not be name, Type.nullthe kind of type to create; must not be kind,nullthe type annotations that should be present on the type instance; may be annotations)nullCreates an instance of specified type with given type |
| public String | Returns: the bytecode descriptor of this type (or its erasure in case of generic types)a substitution function from type variable identifiers to types typeVariableSubstitution)Implements org. |
| public boolean | Returns: true if equalthe type to compare to o)Overrides java. Type with another type.
|
| public final boolean | Returns: true if the annotation is present, false otherwisename of the annotation type to look for, must not be name)nullReturns whether an annotation instance with given name is declared on this type usage. |
| public int | Returns: the hash codeOverrides java. |
| pack-priv boolean | |
| pack-priv int | |
| public abstract Type. | |
| public DotName | Returns: the name of this type (or its erasure in case of generic types)Returns the name of this type (or its erasure in case of generic types) as a |
| public String | Returns: the string representation.Overrides java. |
| pack-priv String |
| annotations | back to summary |
|---|---|
| private final AnnotationInstance[] annotations | |
| EMPTY_ANNOTATIONS | back to summary |
|---|---|
| private static final AnnotationInstance[] EMPTY_ANNOTATIONS | |
| EMPTY_ARRAY | back to summary |
|---|---|
| public static final Type[] EMPTY_ARRAY | |
| name | back to summary |
|---|---|
| private final DotName name | |
| Type | back to summary |
|---|---|
| pack-priv Type(DotName name, AnnotationInstance[] annotations) | |
| addAnnotation | back to summary |
|---|---|
| pack-priv Type addAnnotation(AnnotationInstance annotation) | |
| annotation | back to summary |
|---|---|
| public final AnnotationInstance annotation(DotName name) Returns the annotation instance with given name declared on this type usage.
To allow for
| |
| annotationArray | back to summary |
|---|---|
| pack-priv AnnotationInstance[] annotationArray() | |
| annotations | back to summary |
|---|---|
| public List Returns the annotation instances declared on this type usage.
To allow for
| |
| annotationsWithRepeatable | back to summary |
|---|---|
| public final List Returns the annotation instances with given name declared on this type usage.
If the specified annotation is repeatable, the result also contains all values from the container annotation
instance. In this case, the
To allow for
| |
| appendAnnotations | back to summary |
|---|---|
| pack-priv void appendAnnotations(StringBuilder builder) | |
| asArrayType | back to summary |
|---|---|
| public ArrayType asArrayType() Casts this type to an
| |
| asClassType | back to summary |
|---|---|
| public ClassType asClassType() Casts this type to a
| |
| asParameterizedType | back to summary |
|---|---|
| public ParameterizedType asParameterizedType() Casts this type to a
| |
| asPrimitiveType | back to summary |
|---|---|
| public PrimitiveType asPrimitiveType() Casts this type to a
| |
| asTypeVariable | back to summary |
|---|---|
| public TypeVariable asTypeVariable() Casts this type to a
| |
| asTypeVariableReference | back to summary |
|---|---|
| public TypeVariableReference asTypeVariableReference() Casts this type to a
| |
| asUnresolvedTypeVariable | back to summary |
|---|---|
| public UnresolvedTypeVariable asUnresolvedTypeVariable() Casts this type to an
| |
| asVoidType | back to summary |
|---|---|
| public VoidType asVoidType() Casts this type to a
| |
| asWildcardType | back to summary |
|---|---|
| public WildcardType asWildcardType() Casts this type to a
| |
| copyType | back to summary |
|---|---|
| pack-priv abstract Type copyType(AnnotationInstance[] newAnnotations) | |
| create | back to summary |
|---|---|
| public static Type create(DotName name, Type. Creates a type of the specified kind and
| |
| createWithAnnotations | back to summary |
|---|---|
| public static Type createWithAnnotations(DotName name, Type. Creates an instance of specified type with given type
| |
| descriptor | back to summary |
|---|---|
| public String descriptor(Function<String, Type> typeVariableSubstitution) Implements org. Returns the bytecode descriptor of this type (or its erasure in case of generic types). Specifically:
typeVariableSubstitution. If the substitution function returns null
for some type variable identifier, or if it returns the type variable itself, no substitution happens
and the type variable descriptor is used unmodified.
Note that the return value does not come directly from bytecode. Jandex does not store the descriptor strings. Instead, the return value is reconstructed from the Jandex object model.
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object o) Overrides java. Compares this
| |
| hasAnnotation | back to summary |
|---|---|
| public final boolean hasAnnotation(DotName name) Returns whether an annotation instance with given name is declared on this type usage.
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Computes a hash code representing this type.
| |
| internEquals | back to summary |
|---|---|
| pack-priv boolean internEquals(Object o) | |
| internHashCode | back to summary |
|---|---|
| pack-priv int internHashCode() | |
| kind | back to summary |
|---|---|
| public abstract Type. Returns the kind of Type this is. | |
| name | back to summary |
|---|---|
| public DotName name() Returns the name of this type (or its erasure in case of generic types) as a
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns a string representation for this type. It is similar, yet not identical to a Java source code representation.
| |
| toString | back to summary |
|---|---|
| pack-priv String toString(boolean simple) | |
| Modifier and Type | Field and Description |
|---|---|
| protected final List | |
| protected final DotName |
| Modifier and Type | Method and Description |
|---|---|
| public THIS | Returns: this builderthe annotation instance; can be created using annotation)AnnotationInstance.builder()Adds an annotation to the type being created by this builder. |
| protected AnnotationInstance[] | |
| protected THIS |
| annotations | back to summary |
|---|---|
| protected final List<AnnotationInstance> annotations | |
| name | back to summary |
|---|---|
| protected final DotName name | |
| Builder | back to summary |
|---|---|
| protected Builder(DotName name) | |
| addAnnotation | back to summary |
|---|---|
| public THIS addAnnotation(AnnotationInstance annotation) Adds an annotation to the type being created by this builder. Note that it becomes a type annotation.
| |
| annotationsArray | back to summary |
|---|---|
protected AnnotationInstance[] annotationsArray()
| |
| self | back to summary |
|---|---|
protected THIS self()
| |
| Modifier and Type | Field and Description |
|---|---|
| public static final Type. | ARRAY
A Java array |
| public static final Type. | CLASS
A Java class, interface, or annotation |
| public static final Type. | PARAMETERIZED_TYPE
A generic parameterized type |
| public static final Type. | PRIMITIVE
A Java primitive (boolean, byte, short, char, int, long, float, double) |
| public static final Type. | TYPE_VARIABLE
A resolved generic type parameter or type argument |
| public static final Type. | TYPE_VARIABLE_REFERENCE
A reference to a resolved type variable occuring in the bound of a recursive type parameter |
| public static final Type. | UNRESOLVED_TYPE_VARIABLE
An unresolved type parameter or argument. |
| public static final Type. | VOID
Used to designate a Java method that returns nothing |
| public static final Type. | WILDCARD_TYPE
A generic wildcard type |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static Type. | |
| public static Type. | |
| public static Type. |
| ARRAY | back to summary |
|---|---|
| public static final Type. A Java array | |
| CLASS | back to summary |
|---|---|
| public static final Type. A Java class, interface, or annotation | |
| PARAMETERIZED_TYPE | back to summary |
|---|---|
| public static final Type. A generic parameterized type | |
| PRIMITIVE | back to summary |
|---|---|
| public static final Type. A Java primitive (boolean, byte, short, char, int, long, float, double) | |
| TYPE_VARIABLE | back to summary |
|---|---|
| public static final Type. A resolved generic type parameter or type argument | |
| TYPE_VARIABLE_REFERENCE | back to summary |
|---|---|
| public static final Type. A reference to a resolved type variable occuring in the bound of a recursive type parameter | |
| UNRESOLVED_TYPE_VARIABLE | back to summary |
|---|---|
| public static final Type. An unresolved type parameter or argument. This is merely a placeholder which occurs during an error condition or incomplete processing. In most cases, it need not be dealt with. | |
| VOID | back to summary |
|---|---|
| public static final Type. Used to designate a Java method that returns nothing | |
| WILDCARD_TYPE | back to summary |
|---|---|
| public static final Type. A generic wildcard type | |
| Kind | back to summary |
|---|---|
| private Kind() | |
| fromOrdinal | back to summary |
|---|---|
| public static Type. | |
| valueOf | back to summary |
|---|---|
| public static Type. | |
| values | back to summary |
|---|---|
| public static Type. | |