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 classClassType.BuilderConvenient builder forClassType.
-
Field Summary
Fields Modifier and Type Field Description static ClassTypeBOOLEAN_CLASSstatic ClassTypeBYTE_CLASSstatic ClassTypeCHARACTER_CLASSstatic ClassTypeCLASS_TYPEstatic ClassTypeDOUBLE_CLASSstatic ClassTypeFLOAT_CLASSstatic ClassTypeINTEGER_CLASSstatic ClassTypeLONG_CLASSstatic ClassTypeOBJECT_TYPEstatic ClassTypeSHORT_CLASSstatic ClassTypeSTRING_TYPEstatic ClassTypeVOID_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 ClassTypeasClassType()Casts this type to aClassTypeand returns it if the kind isType.Kind.CLASS.static ClassType.Builderbuilder(java.lang.Class<?> clazz)Create a builder of a class type for the given class.static ClassType.Builderbuilder(DotName name)Create a builder of a class type with the givenname.(package private) TypecopyType(AnnotationInstance[] newAnnotations)static ClassTypecreate(java.lang.Class<?> clazz)Create an instance of a class type for givenclazz.static ClassTypecreate(java.lang.String name)Create an instance of a class type with givenname.static ClassTypecreate(DotName name)Create an instance of a class type with givenname.Type.Kindkind()Returns the kind of Type this is.(package private) ParameterizedTypetoParameterizedType()-
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:TypeCasts this type to aClassTypeand returns it if the kind isType.Kind.CLASS. Throws an exception otherwise.- Overrides:
asClassTypein classType- Returns:
- a
ClassType
-
copyType
Type copyType(AnnotationInstance[] newAnnotations)
-
toParameterizedType
ParameterizedType toParameterizedType()
-
-