Package org.jboss.jandex
Class JandexReflection
java.lang.Object
org.jboss.jandex.JandexReflection
Utilities that allow moving from the Jandex world to the runtime world using reflection.
To maintain stratification, these methods are intentionally not present
on the respective Jandex classes.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
JandexReflection
public JandexReflection()
-
-
Method Details
-
loadRawType
Loads a class corresponding to the raw type of givenTypefrom the thread context classloader. If there is no TCCL, the classloader that loadedJandexReflectionis used. Returnsnullwhentypeisnull.Specifically:
- for the
voidpseudo-type, returnsvoid.class; - for primitive types, returns the corresponding class object (e.g.
int.class); - for class types, returns the corresponding class object (e.g.
String.class); - for array types, returns the corresponding class object (e.g.
String[][].class); - for parameterized types, returns the class object of the generic class
(e.g.
List.classforList<String>); - for wildcard types, returns the class object of the upper bound type
(e.g.
Number.classfor? extends Number), orObject.classif the wildcard type has no upper bound (e.g.? super Integer); - for type variables, returns the class object of the first bound
(e.g.
Number.classforT extends Number & Comparable<T>), orObject.classif the type variable has no bounds (e.g. justT); - for type variables references, follows the reference to obtain the type
variable and then returns the class object of the first bound (e.g.
Number.classforT extends Number & Comparable<T>), orObject.classif the type variable has no bounds (e.g. justT); - for unresolved type variables, returns
Object.class.
- for the
-
loadClass
Loads a class corresponding to givenClassInfofrom the thread context classloader. If there is no TCCL, the classloader that loadedJandexReflectionis used. Returnsnullwhenclazzisnull.
-