Package org.jboss.jandex.gizmo2
Class Jandex2Gizmo
java.lang.Object
org.jboss.jandex.gizmo2.Jandex2Gizmo
Bridge methods from
org.jboss.jandex types to the Gizmo 2 API.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddAnnotation(io.quarkus.gizmo2.creator.AnnotatableCreator annotatableCreator, org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.IndexView index) Adds the givenannotationto the givenannotatableCreator.static voidaddTypeParameter(org.jboss.jandex.TypeVariable typeParameter, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Adds the giventypeParameterto the givencreator.static ClassDescclassDescOf(org.jboss.jandex.ClassInfo clazz) Returns theClassDesccorresponding to the given JandexClassInfo.static ClassDescclassDescOf(org.jboss.jandex.DotName name) Returns theClassDesccorresponding to the given JandexDotName.static ClassDescclassDescOf(org.jboss.jandex.Type type) Returns theClassDesccorresponding to the erasure of given JandexType.static io.quarkus.gizmo2.ConstconstOfEnum(org.jboss.jandex.FieldInfo enumConstant) Returns an enum constant corresponding to the given JandexFieldInfo.static io.quarkus.gizmo2.desc.ConstructorDescconstructorDescOf(org.jboss.jandex.MethodInfo ctor) Returns theConstructorDesccorresponding to the given JandexMethodInfo.static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.AnnotationTarget annotationTarget, org.jboss.jandex.IndexView index) Returns anAnnotatableCreatorconsumer that copies all annotations from givenAnnotationTarget.static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns anAnnotatableCreatorconsumer that copies all annotations from givenType.static voidcopyModifiers(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.ClassCreator creator) Copies all modifiers (including the access level) from the given Jandexclazzto the givencreator.static voidcopyModifiers(org.jboss.jandex.FieldInfo field, io.quarkus.gizmo2.creator.FieldCreator creator) Copies all modifiers (including the access level) from the given Jandexfieldto the givencreator.static voidcopyModifiers(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.MethodCreator creator) Copies all modifiers (including the access level) from the given Jandexmethodto the givencreator.static voidcopyTypeParameters(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Copies type parameters from givenclazzto the givencreator, preserving order.static voidcopyTypeParameters(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Copies type parameters from givenmethodto the givencreator, preserving order.static io.quarkus.gizmo2.desc.FieldDescfieldDescOf(org.jboss.jandex.FieldInfo field) Returns theFieldDesccorresponding to the given JandexFieldInfo.static io.quarkus.gizmo2.GenericTypegenericTypeOf(org.jboss.jandex.DotName name) Returns aGenericTypecorresponding to the given JandexDotName.static io.quarkus.gizmo2.GenericTypegenericTypeOf(org.jboss.jandex.Type type) Returns aGenericTypecorresponding to the given JandexType.static io.quarkus.gizmo2.GenericTypegenericTypeOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericTypecorresponding to the given JandexType.static io.quarkus.gizmo2.GenericType.OfArraygenericTypeOfArray(org.jboss.jandex.Type type) Returns aGenericType.OfArraycorresponding to the given Jandex arrayType.static io.quarkus.gizmo2.GenericType.OfArraygenericTypeOfArray(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfArraycorresponding to the given Jandex arrayType.static io.quarkus.gizmo2.GenericType.OfClassgenericTypeOfClass(org.jboss.jandex.Type type) Returns aGenericType.OfClasscorresponding to the given Jandex class or parameterizedType.static io.quarkus.gizmo2.GenericType.OfClassgenericTypeOfClass(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfClasscorresponding to the given Jandex class or parameterizedType.static io.quarkus.gizmo2.GenericType.OfPrimitivegenericTypeOfPrimitive(org.jboss.jandex.Type type) Returns aGenericType.OfPrimitivecorresponding to the given Jandex primitiveType.static io.quarkus.gizmo2.GenericType.OfPrimitivegenericTypeOfPrimitive(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfPrimitivecorresponding to the given Jandex primitiveType.static io.quarkus.gizmo2.GenericType.OfReferencegenericTypeOfReference(org.jboss.jandex.Type type) Returns aGenericType.OfReferencecorresponding to the given Jandex referenceType.static io.quarkus.gizmo2.GenericType.OfReferencegenericTypeOfReference(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfReferencecorresponding to the given Jandex referenceType.static io.quarkus.gizmo2.GenericType.OfThrowsgenericTypeOfThrows(org.jboss.jandex.Type type) Returns aGenericType.OfThrowscorresponding to the given Jandex throwableType.static io.quarkus.gizmo2.GenericType.OfThrowsgenericTypeOfThrows(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfThrowscorresponding to the given Jandex throwableType.static io.quarkus.gizmo2.GenericType.OfTypeVariablegenericTypeOfTypeVariable(org.jboss.jandex.Type type) Returns aGenericType.OfTypeVariablecorresponding to the given JandexTypevariable.static io.quarkus.gizmo2.GenericType.OfTypeVariablegenericTypeOfTypeVariable(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfTypeVariablecorresponding to the given JandexTypevariable.static io.quarkus.gizmo2.desc.MethodDescmethodDescOf(org.jboss.jandex.MethodInfo method) Returns theMethodDesccorresponding to the given JandexMethodInfo.static io.quarkus.gizmo2.TypeArgumenttypeArgumentOf(org.jboss.jandex.Type type) Returns aTypeArgumentcorresponding to the given JandexType.static io.quarkus.gizmo2.TypeArgumenttypeArgumentOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aTypeArgumentcorresponding to the given JandexType.
-
Constructor Details
-
Jandex2Gizmo
public Jandex2Gizmo()
-
-
Method Details
-
classDescOf
Returns theClassDesccorresponding to the given JandexDotName. SeeType.name()for the description of the format this method recognizes.- Parameters:
name- the JandexDotName(must not benull)- Returns:
- the
ClassDesccorresponding to the given JandexDotName
-
classDescOf
Returns theClassDesccorresponding to the erasure of given JandexType.- Parameters:
type- the Jandex type (must not benull)- Returns:
- the
ClassDesccorresponding to the erasure of given JandexType
-
classDescOf
Returns theClassDesccorresponding to the given JandexClassInfo.- Parameters:
clazz- the Jandex class (must not benull)- Returns:
- the
ClassDesccorresponding to the given JandexClassInfo
-
fieldDescOf
public static io.quarkus.gizmo2.desc.FieldDesc fieldDescOf(org.jboss.jandex.FieldInfo field) Returns theFieldDesccorresponding to the given JandexFieldInfo.- Parameters:
field- the Jandex field (must not benull)- Returns:
- the
FieldDesccorresponding to the given JandexFieldInfo
-
methodDescOf
public static io.quarkus.gizmo2.desc.MethodDesc methodDescOf(org.jboss.jandex.MethodInfo method) Returns theMethodDesccorresponding to the given JandexMethodInfo.- Parameters:
method- the Jandex method (must not benull)- Returns:
- the
MethodDesccorresponding to the given JandexMethodInfo - Throws:
IllegalArgumentException- if themethodis a static initializer or constructor
-
constructorDescOf
public static io.quarkus.gizmo2.desc.ConstructorDesc constructorDescOf(org.jboss.jandex.MethodInfo ctor) Returns theConstructorDesccorresponding to the given JandexMethodInfo.- Parameters:
ctor- the Jandex constructor (must not benull)- Returns:
- the
ConstructorDesccorresponding to the given JandexMethodInfo - Throws:
IllegalArgumentException- if thectoris not a constructor
-
genericTypeOf
public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.DotName name) Returns aGenericTypecorresponding to the given JandexDotName.- Parameters:
name- the JandexDotName(must not benull)- Returns:
- a
GenericTypecorresponding to the given JandexDotName
-
genericTypeOf
public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.Type type) Returns aGenericTypecorresponding to the given JandexType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericTypecorresponding to the given JandexType
-
genericTypeOf
public static io.quarkus.gizmo2.GenericType genericTypeOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericTypecorresponding to the given JandexType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericTypecorresponding to the given JandexType
-
genericTypeOfPrimitive
public static io.quarkus.gizmo2.GenericType.OfPrimitive genericTypeOfPrimitive(org.jboss.jandex.Type type) Returns aGenericType.OfPrimitivecorresponding to the given Jandex primitiveType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfPrimitivecorresponding to the given Jandex primitiveType - Throws:
IllegalArgumentException- if the giventypeis not a primitive type orvoid
-
genericTypeOfPrimitive
public static io.quarkus.gizmo2.GenericType.OfPrimitive genericTypeOfPrimitive(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfPrimitivecorresponding to the given Jandex primitiveType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfPrimitivecorresponding to the given Jandex primitiveType - Throws:
IllegalArgumentException- if the giventypeis not a primitive type orvoid
-
genericTypeOfReference
public static io.quarkus.gizmo2.GenericType.OfReference genericTypeOfReference(org.jboss.jandex.Type type) Returns aGenericType.OfReferencecorresponding to the given Jandex referenceType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfReferencecorresponding to the given Jandex referenceType - Throws:
IllegalArgumentException- if the giventypeis not a reference type
-
genericTypeOfReference
public static io.quarkus.gizmo2.GenericType.OfReference genericTypeOfReference(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfReferencecorresponding to the given Jandex referenceType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfReferencecorresponding to the given Jandex referenceType - Throws:
IllegalArgumentException- if the giventypeis not a reference type
-
genericTypeOfArray
public static io.quarkus.gizmo2.GenericType.OfArray genericTypeOfArray(org.jboss.jandex.Type type) Returns aGenericType.OfArraycorresponding to the given Jandex arrayType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfArraycorresponding to the given Jandex arrayType - Throws:
IllegalArgumentException- if the giventypeis not an array type
-
genericTypeOfArray
public static io.quarkus.gizmo2.GenericType.OfArray genericTypeOfArray(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfArraycorresponding to the given Jandex arrayType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfArraycorresponding to the given Jandex arrayType - Throws:
IllegalArgumentException- if the giventypeis not an array type
-
genericTypeOfThrows
public static io.quarkus.gizmo2.GenericType.OfThrows genericTypeOfThrows(org.jboss.jandex.Type type) Returns aGenericType.OfThrowscorresponding to the given Jandex throwableType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfThrowscorresponding to the given Jandex throwableType - Throws:
IllegalArgumentException- if the giventypeis not a throwable type
-
genericTypeOfThrows
public static io.quarkus.gizmo2.GenericType.OfThrows genericTypeOfThrows(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfThrowscorresponding to the given Jandex throwableType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfThrowscorresponding to the given Jandex throwableType - Throws:
IllegalArgumentException- if the giventypeis not a throwable type
-
genericTypeOfClass
public static io.quarkus.gizmo2.GenericType.OfClass genericTypeOfClass(org.jboss.jandex.Type type) Returns aGenericType.OfClasscorresponding to the given Jandex class or parameterizedType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfClasscorresponding to the given Jandex class or parameterizedType - Throws:
IllegalArgumentException- if the giventypeis not a class or parameterized type
-
genericTypeOfClass
public static io.quarkus.gizmo2.GenericType.OfClass genericTypeOfClass(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfClasscorresponding to the given Jandex class or parameterizedType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfClasscorresponding to the given Jandex class or parameterizedType - Throws:
IllegalArgumentException- if the giventypeis not a class or parameterized type
-
genericTypeOfTypeVariable
public static io.quarkus.gizmo2.GenericType.OfTypeVariable genericTypeOfTypeVariable(org.jboss.jandex.Type type) Returns aGenericType.OfTypeVariablecorresponding to the given JandexTypevariable. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
GenericType.OfTypeVariablecorresponding to the given JandexTypevariable - Throws:
IllegalArgumentException- if the giventypeis not a type variable
-
genericTypeOfTypeVariable
public static io.quarkus.gizmo2.GenericType.OfTypeVariable genericTypeOfTypeVariable(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aGenericType.OfTypeVariablecorresponding to the given JandexTypevariable. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
GenericType.OfTypeVariablecorresponding to the given JandexTypevariable - Throws:
IllegalArgumentException- if the giventypeis not a type variable
-
typeArgumentOf
public static io.quarkus.gizmo2.TypeArgument typeArgumentOf(org.jboss.jandex.Type type) Returns aTypeArgumentcorresponding to the given JandexType. The result does not include type annotations.- Parameters:
type- the JandexType(must not benull)- Returns:
- a
TypeArgumentcorresponding to the given JandexType - Throws:
IllegalArgumentException- if the giventypecannot be a type argument
-
typeArgumentOf
public static io.quarkus.gizmo2.TypeArgument typeArgumentOf(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns aTypeArgumentcorresponding to the given JandexType. The result includes type annotations if theindexis notnull.- Parameters:
type- the JandexType(must not benull)index- the Jandex index that contains classes of type annotations (may benull)- Returns:
- a
TypeArgumentcorresponding to the given JandexType - Throws:
IllegalArgumentException- if the giventypecannot be a type argument
-
copyTypeParameters
public static void copyTypeParameters(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Copies type parameters from givenclazzto the givencreator, preserving order.- Parameters:
clazz- the JandexClassInfo(must not benull)creator- the GizmoTypeParameterizedCreator(must not benull)
-
copyTypeParameters
public static void copyTypeParameters(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Copies type parameters from givenmethodto the givencreator, preserving order.- Parameters:
method- the JandexMethodInfo(must not benull)creator- the GizmoTypeParameterizedCreator(must not benull)
-
addTypeParameter
public static void addTypeParameter(org.jboss.jandex.TypeVariable typeParameter, io.quarkus.gizmo2.creator.TypeParameterizedCreator creator) Adds the giventypeParameterto the givencreator.- Parameters:
typeParameter- the JandexTypeVariable(must not benull)creator- the GizmoTypeParameterizedCreator(must not benull)
-
copyAnnotations
public static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.AnnotationTarget annotationTarget, org.jboss.jandex.IndexView index) Returns anAnnotatableCreatorconsumer that copies all annotations from givenAnnotationTarget.- Parameters:
annotationTarget- theAnnotationTargetfrom which to copy the annotations (must not benull)index- the Jandex index that contains annotation classes (must not benull)- Returns:
- an
AnnotatableCreatorconsumer that copies all annotations from givenAnnotationTarget
-
copyAnnotations
public static Consumer<io.quarkus.gizmo2.creator.AnnotatableCreator> copyAnnotations(org.jboss.jandex.Type type, org.jboss.jandex.IndexView index) Returns anAnnotatableCreatorconsumer that copies all annotations from givenType.- Parameters:
type- theTypefrom which to copy the annotations (must not benull)index- the Jandex index that contains annotation classes (must not benull)- Returns:
- an
AnnotatableCreatorconsumer that copies all annotations from givenType
-
addAnnotation
public static void addAnnotation(io.quarkus.gizmo2.creator.AnnotatableCreator annotatableCreator, org.jboss.jandex.AnnotationInstance annotation, org.jboss.jandex.IndexView index) Adds the givenannotationto the givenannotatableCreator.- Parameters:
annotatableCreator- theAnnotatableCreatorto which to add the annotation (must not benull)annotation- theAnnotationInstanceto add (must not benull)index- the Jandex index that contains annotation classes (must not benull)
-
constOfEnum
public static io.quarkus.gizmo2.Const constOfEnum(org.jboss.jandex.FieldInfo enumConstant) Returns an enum constant corresponding to the given JandexFieldInfo.- Parameters:
enumConstant- the Jandex enum constant (must not benull)- Returns:
- an enum constant corresponding to the given Jandex
FieldInfo - Throws:
IllegalArgumentException- if theenumConstantis not an actual enum constant
-
copyModifiers
public static void copyModifiers(org.jboss.jandex.ClassInfo clazz, io.quarkus.gizmo2.creator.ClassCreator creator) Copies all modifiers (including the access level) from the given Jandexclazzto the givencreator.- Parameters:
clazz- the Jandex class (must not benull)creator- the Gizmo class creator (must not benull)
-
copyModifiers
public static void copyModifiers(org.jboss.jandex.MethodInfo method, io.quarkus.gizmo2.creator.MethodCreator creator) Copies all modifiers (including the access level) from the given Jandexmethodto the givencreator.- Parameters:
method- the Jandex method (must not benull)creator- the Gizmo method creator (must not benull)
-
copyModifiers
public static void copyModifiers(org.jboss.jandex.FieldInfo field, io.quarkus.gizmo2.creator.FieldCreator creator) Copies all modifiers (including the access level) from the given Jandexfieldto the givencreator.- Parameters:
field- the Jandex field (must not benull)creator- the Gizmo field creator (must not benull)
-