Class ClassType
- java.lang.Object
-
- org.jboss.jandex.Type
-
- org.jboss.jandex.ClassType
-
- All Implemented Interfaces:
Descriptor
public final class ClassType extends Type
Represents a class type. Class types also include erasures of parameterized types.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType
, where the enclosing type is represented as the parameterized type's owner.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ClassType.Builder
Convenient builder forClassType
.
-
Field Summary
Fields Modifier and Type Field Description static ClassType
BOOLEAN_CLASS
static ClassType
BYTE_CLASS
static ClassType
CHARACTER_CLASS
static ClassType
CLASS_TYPE
static ClassType
DOUBLE_CLASS
static ClassType
FLOAT_CLASS
static ClassType
INTEGER_CLASS
static ClassType
LONG_CLASS
static ClassType
OBJECT_TYPE
static ClassType
SHORT_CLASS
static ClassType
STRING_TYPE
static ClassType
VOID_CLASS
-
Fields inherited from class org.jboss.jandex.Type
EMPTY_ARRAY
-
Fields inherited from interface org.jboss.jandex.Descriptor
NO_SUBSTITUTION
-
-
Constructor Summary
Constructors Constructor Description ClassType(DotName name)
ClassType(DotName name, AnnotationInstance[] annotations)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ClassType
asClassType()
Casts this type to aClassType
and returns it if the kind isType.Kind.CLASS
.static ClassType.Builder
builder(java.lang.Class<?> clazz)
Create a builder of a class type for the given class.static ClassType.Builder
builder(DotName name)
Create a builder of a class type with the givenname
.(package private) Type
copyType(AnnotationInstance[] newAnnotations)
static ClassType
create(java.lang.Class<?> clazz)
Create an instance of a class type for givenclazz
.static ClassType
create(java.lang.String name)
Create an instance of a class type with givenname
.static ClassType
create(DotName name)
Create an instance of a class type with givenname
.Type.Kind
kind()
Returns the kind of Type this is.(package private) ParameterizedType
toParameterizedType()
-
Methods inherited from class org.jboss.jandex.Type
addAnnotation, annotation, annotationArray, annotations, annotationsWithRepeatable, appendAnnotations, asArrayType, asParameterizedType, asPrimitiveType, asTypeVariable, asTypeVariableReference, asUnresolvedTypeVariable, asVoidType, asWildcardType, create, createWithAnnotations, descriptor, equals, hasAnnotation, hashCode, internEquals, internHashCode, name, parse, toString, toString, withoutAnnotations
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jboss.jandex.Descriptor
descriptor
-
-
-
-
Field Detail
-
OBJECT_TYPE
public static final ClassType OBJECT_TYPE
-
STRING_TYPE
public static final ClassType STRING_TYPE
-
CLASS_TYPE
public static final ClassType CLASS_TYPE
-
BYTE_CLASS
public static final ClassType BYTE_CLASS
-
CHARACTER_CLASS
public static final ClassType CHARACTER_CLASS
-
DOUBLE_CLASS
public static final ClassType DOUBLE_CLASS
-
FLOAT_CLASS
public static final ClassType FLOAT_CLASS
-
INTEGER_CLASS
public static final ClassType INTEGER_CLASS
-
LONG_CLASS
public static final ClassType LONG_CLASS
-
SHORT_CLASS
public static final ClassType SHORT_CLASS
-
BOOLEAN_CLASS
public static final ClassType BOOLEAN_CLASS
-
VOID_CLASS
public static final ClassType VOID_CLASS
-
-
Constructor Detail
-
ClassType
ClassType(DotName name)
-
ClassType
ClassType(DotName name, AnnotationInstance[] annotations)
-
-
Method Detail
-
create
public static ClassType create(DotName name)
Create an instance of a class type with givenname
.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType
, where the enclosing type is represented as the parameterized type's owner.- Parameters:
name
- the binary name of this class type- Returns:
- the class type
- Since:
- 3.0.4
-
create
public static ClassType create(java.lang.String name)
Create an instance of a class type with givenname
.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType
, where the enclosing type is represented as the parameterized type's owner.- Parameters:
name
- the binary name of this class type- Returns:
- the class type
- Since:
- 3.1.0
-
create
public static ClassType create(java.lang.Class<?> clazz)
Create an instance of a class type for givenclazz
.Note that an inner class type enclosed in a parameterized type or in a type annotated with a type annotation is represented as
ParameterizedType
, where the enclosing type is represented as the parameterized type's owner.- Parameters:
clazz
- the class- Returns:
- the class type
- Since:
- 3.1.0
-
builder
public static ClassType.Builder builder(DotName name)
Create a builder of a class type with the givenname
.- Parameters:
name
- binary name of the class- Returns:
- the builder
- Since:
- 3.1.0
-
builder
public static ClassType.Builder builder(java.lang.Class<?> clazz)
Create a builder of a class type for the given class.- Parameters:
clazz
- the class- Returns:
- the builder
- Since:
- 3.1.0
-
asClassType
public ClassType asClassType()
Description copied from class:Type
Casts this type to aClassType
and returns it if the kind isType.Kind.CLASS
. Throws an exception otherwise.- Overrides:
asClassType
in classType
- Returns:
- a
ClassType
-
copyType
Type copyType(AnnotationInstance[] newAnnotations)
-
toParameterizedType
ParameterizedType toParameterizedType()
-
-