Top Description Constructors Methods
org.jboss.jandex

public Class JandexReflection

extends Object
Class Inheritance

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

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private static Class<?>
load(DotName name)

public static Class<?>

Returns:

the corresponding Class
loadClass
(ClassInfo
a Jandex ClassInfo
clazz
)

Loads a class corresponding to given ClassInfo from the thread context classloader.

public static Class<?>

Returns:

the corresponding Class
loadRawType
(Type
a Jandex Type
type
)

Loads a class corresponding to the raw type of given Type from the thread context classloader.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

JandexReflectionback to summary
public JandexReflection()

Method Detail

loadback to summary
private static Class<?> load(DotName name)
loadClassback to summary
public static Class<?> loadClass(ClassInfo clazz)

Loads a class corresponding to given ClassInfo from the thread context classloader. If there is no TCCL, the classloader that loaded JandexReflection is used. Returns null when clazz is null.

Parameters
clazz:ClassInfo

a Jandex ClassInfo

Returns:Class<?>

the corresponding Class

loadRawTypeback to summary
public static Class<?> loadRawType(Type type)

Loads a class corresponding to the raw type of given Type from the thread context classloader. If there is no TCCL, the classloader that loaded JandexReflection is used. Returns null when type is null.

Specifically:

  • for the void pseudo-type, returns void.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.class for List<String>);
  • for wildcard types, returns the class object of the upper bound type (e.g. Number.class for ? extends Number), or Object.class if 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.class for T extends Number & Comparable<T>), or Object.class if the type variable has no bounds (e.g. just T);
  • 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.class for T extends Number & Comparable<T>), or Object.class if the type variable has no bounds (e.g. just T);
  • for unresolved type variables, returns Object.class.
Parameters
type:Type

a Jandex Type

Returns:Class<?>

the corresponding Class