public final class RuntimeReflection extends Object
Modifier and Type | Method and Description |
---|---|
static void |
register(boolean finalIsWritable,
Field... fields)
Makes the provided fields available for reflection at run time.
|
static void |
register(Class<?>... classes)
Makes the provided classes available for reflection at run time.
|
static void |
register(Executable... methods)
Makes the provided methods available for reflection at run time.
|
static void |
register(Field... fields)
Makes the provided fields available for reflection at run time.
|
static void |
registerForReflectiveInstantiation(Class<?>... classes)
Makes the provided classes available for reflective instantiation by
Class.newInstance() . |
public static void register(Class<?>... classes)
Class.forName(java.lang.String)
for the names of the classes will return the classes at run time.public static void register(Executable... methods)
Class.getMethod(java.lang.String, java.lang.Class<?>...)
, Class.getMethods()
,and all the other methods on
Class
that return a single or a list of methods.public static void register(Field... fields)
Class.getField(java.lang.String)
, Class.getFields()
,and all the other methods on Class
that return a single or a list of fields.public static void register(boolean finalIsWritable, Field... fields)
Class.getField(java.lang.String)
, Class.getFields()
,and all the other methods on Class
that return a single or a list of fields.finalIsWritable
- for all of the passed fields which are marked final
, indicates
whether it should be possible to change their value using reflection.public static void registerForReflectiveInstantiation(Class<?>... classes)
Class.newInstance()
. This is equivalent to registering the nullary constructors of the
classes.