java.lang.Object
io.quarkus.gizmo2.Reflection2Gizmo
Bridge methods from
java.lang.reflect types to the Gizmo API.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ClassDescclassDescOf(Class<?> clazz) Returns aClassDescfor the givenclazz.static Consumer<AnnotatableCreator>copyAnnotations(AnnotatedElement element) Copy all of the annotations from the given annotated element.static booleanReturnstrueif the two descriptors are equal, orfalseif they are not.static ClassDescReturns an erasure of the giventype.static GenericType.OfArrayReturns the given annotated array reflection type as a generic type (notnull).static GenericTypeReturns the given annotated parameterized type as a generic type (notnull).static GenericTypegenericTypeOf(AnnotatedType type) Returns the given annotated reflection type as a generic type (notnull).static GenericType.OfTypeVariableReturns the given type variable annotated reflection type as a generic type (notnull).static GenericType.OfArrayReturns the given array reflection type as a generic type (notnull).static GenericType.OfClassReturns the given parameterized reflection type as a generic type (notnull).static GenericTypegenericTypeOf(Type type) Returns the given reflection type as a generic type (notnull).static GenericType.OfTypeVariablegenericTypeOf(TypeVariable<?> type) Returns the given type variable reflection type as a generic type (notnull).static TypeArgumenttypeArgumentOf(AnnotatedType type) Returns a type argument for the given annotated generic reflection type.static TypeArgument.OfWildcardReturns a type argument for the given annotated reflection wildcard type.static TypeArgumenttypeArgumentOf(Type type) Returns a type argument for the given generic reflection type.static TypeArgument.OfWildcardtypeArgumentOf(WildcardType type) Returns a type argument for the given reflection wildcard type.static TypeParametertypeParameterOf(TypeVariable<?> typeVar) Returns a type parameter for the given type variable.
-
Constructor Details
-
Reflection2Gizmo
public Reflection2Gizmo()
-
-
Method Details
-
classDescOf
Returns aClassDescfor the givenclazz.- Parameters:
clazz- the class (must not benull)- Returns:
- the
ClassDesc(notnull)
-
equals
Returnstrueif the two descriptors are equal, orfalseif they are not. Generally more efficient than callingClassDesc.equals(other)on the descriptor itself.- Returns:
trueif the two descriptors are equal, orfalseif they are not
-
erasureOf
Returns an erasure of the giventype.- Parameters:
type- the type (must not benull)- Returns:
- an erasure of the given
type
-
genericTypeOf
Returns the given reflection type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given reflection type as a generic type (not
null) - Throws:
IllegalArgumentException- if the given type is a wildcard type or is not recognized
-
genericTypeOf
Returns the given array reflection type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given array reflection type as a generic type (not
null)
-
genericTypeOf
Returns the given type variable reflection type as a generic type (notnull).- Parameters:
type- the type variable (must not benull)- Returns:
- the given type variable reflection type as a generic type (not
null)
-
genericTypeOf
Returns the given parameterized reflection type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given parameterized reflection type as a generic type (not
null)
-
genericTypeOf
Returns the given annotated reflection type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given annotated reflection type as a generic type (not
null) - Throws:
IllegalArgumentException- if the given type is a wildcard type or is not recognized
-
genericTypeOf
Returns the given annotated array reflection type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given annotated array reflection type as a generic type (not
null)
-
genericTypeOf
Returns the given annotated parameterized type as a generic type (notnull).- Parameters:
type- the type (must not benull)- Returns:
- the given annotated parameterized type as a generic type (not
null)
-
genericTypeOf
Returns the given type variable annotated reflection type as a generic type (notnull).- Parameters:
type- the type variable (must not benull)- Returns:
- the given type variable annotated reflection type as a generic type (not
null)
-
typeParameterOf
Returns a type parameter for the given type variable.- Parameters:
typeVar- the type variable (must not benull)- Returns:
- a type parameter for the given type variable
-
typeArgumentOf
Returns a type argument for the given generic reflection type.- Parameters:
type- the argument type (must not benull)- Returns:
- a type argument for the given generic reflection type
-
typeArgumentOf
Returns a type argument for the given reflection wildcard type.- Parameters:
type- the argument type (must not benull)- Returns:
- a type argument for the given reflection wildcard type
-
typeArgumentOf
Returns a type argument for the given annotated generic reflection type. If the type is an annotated wildcard type, then the type argument will be a wildcard type with any annotations attached to the given type. Otherwise, the result will be an exact type argument whose type will have any annotations attached to the given type.- Parameters:
type- the argument type (must not benull)- Returns:
- a type argument for the given annotated generic reflection type
-
typeArgumentOf
Returns a type argument for the given annotated reflection wildcard type.- Parameters:
type- the argument type (must not benull)- Returns:
- a type argument for the given annotated reflection wildcard type
-
copyAnnotations
Copy all of the annotations from the given annotated element.- Parameters:
element- the annotated element (must not benull)- Returns:
- a consumer which copies the annotations (not
null)
-