Top Description Inners Fields Constructors Methods
nonapi.io.github.classgraph.reflection

pack-priv Class JVMDriverReflectionDriver

extends ReflectionDriver
Class Inheritance
Imports
java.lang.reflect.AccessibleObject, .Constructor, .Field, .Method

Reflection driver for the jvm-driver library, if it is available at runtime. This library allows access to non-public fields and methods, circumventing encapsulation and visibility controls, via a range of JVM-native tactics.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface

Field Summary

Modifier and TypeField and Description
private JVMDriverReflectionDriver.ClassFinder
private Object
private final Method
private final Method
private final Method
private final Method
private final Method
private final Method
private final Method

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Class<?>
findClass(final String
the class name
className
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.findClass.

Find a class by name.

pack-priv <T> Constructor<T>[]
getDeclaredConstructors(final Class<T>
the class
cls
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredConstructors.

Get declared constructors for class.

pack-priv Field[]
getDeclaredFields(final Class<?>
the class
cls
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredFields.

Get declared fields for class.

pack-priv Method[]
getDeclaredMethods(final Class<?>
the class
cls
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredMethods.

Get declared methods for class.

pack-priv Object
getField(final Object
the object instance to get the field value from
object
,
final Field
the non-static field
field
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getField.

Get the value of a non-static field, boxing the value if necessary.

pack-priv Object
getStaticField(final Field
the static field
field
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getStaticField.

Get the value of a static field, boxing the value if necessary.

pack-priv Object
invokeMethod(final Object
the object instance to invoke the method on
object
,
final Method
the non-static method
method
,
final Object...
the method arguments (or new Object[0] if there are no args)
args
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeMethod.

Invoke a non-static method, boxing the result if necessary.

pack-priv Object
invokeStaticMethod(final Method
the static method
method
,
final Object...
the method arguments (or new Object[0] if there are no args)
args
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeStaticMethod.

Invoke a static method, boxing the result if necessary.

public boolean
makeAccessible(final Object
the object instance, or null if static.
instance
,
final AccessibleObject
the field or method.
accessibleObject
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.makeAccessible.

Make a field or method accessible.

pack-priv void
setField(final Object
the object instance to get the field value from
object
,
final Field
the non-static field
field
,
final Object
the value to set
value
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.setField.

Set the value of a non-static field, unboxing the value if necessary.

pack-priv void
setStaticField(final Field
the static field
field
,
final Object
the value to set
value
)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.setStaticField.

Set the value of a static field, unboxing the value if necessary.

Inherited from nonapi.io.github.classgraph.reflection.ReflectionDriver:
findFieldfindInstanceFieldfindInstanceMethodfindMethodfindStaticFieldfindStaticMethodisAccessible

Field Detail

classFinderback to summary
private JVMDriverReflectionDriver.ClassFinder classFinder
driverback to summary
private Object driver
getDeclaredConstructorsback to summary
private final Method getDeclaredConstructors
getDeclaredFieldsback to summary
private final Method getDeclaredFields
getDeclaredMethodsback to summary
private final Method getDeclaredMethods
getFieldback to summary
private final Method getField
invokeMethodback to summary
private final Method invokeMethod
setAccessibleMethodback to summary
private final Method setAccessibleMethod
setFieldback to summary
private final Method setField

Constructor Detail

JVMDriverReflectionDriverback to summary
pack-priv JVMDriverReflectionDriver() throws Exception

Method Detail

findClassback to summary
pack-priv Class<?> findClass(final String className) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.findClass.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.findClass.

Find a class by name.

Parameters
className:String

the class name

Returns:Class<?>

the class reference

Annotations
@Override
getDeclaredConstructorsback to summary
pack-priv <T> Constructor<T>[] getDeclaredConstructors(final Class<T> cls) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredConstructors.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredConstructors.

Get declared constructors for class.

Parameters
<T>
the generic type
cls:Class<T>

the class

Returns:Constructor<T>[]

the declared constructors

Annotations
@SuppressWarnings:unchecked
@Override
getDeclaredFieldsback to summary
pack-priv Field[] getDeclaredFields(final Class<?> cls) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredFields.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredFields.

Get declared fields for class.

Parameters
cls:Class<?>

the class

Returns:Field[]

the declared fields

Annotations
@Override
getDeclaredMethodsback to summary
pack-priv Method[] getDeclaredMethods(final Class<?> cls) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredMethods.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.getDeclaredMethods.

Get declared methods for class.

Parameters
cls:Class<?>

the class

Returns:Method[]

the declared methods

Annotations
@Override
getFieldback to summary
pack-priv Object getField(final Object object, final Field field) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getField.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.getField.

Get the value of a non-static field, boxing the value if necessary.

Parameters
object:Object

the object instance to get the field value from

field:Field

the non-static field

Returns:Object

the value of the field

Annotations
@Override
getStaticFieldback to summary
pack-priv Object getStaticField(final Field field) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.getStaticField.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.getStaticField.

Get the value of a static field, boxing the value if necessary.

Parameters
field:Field

the static field

Returns:Object

the static field

Annotations
@Override
invokeMethodback to summary
pack-priv Object invokeMethod(final Object object, final Method method, final Object... args) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeMethod.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeMethod.

Invoke a non-static method, boxing the result if necessary.

Parameters
object:Object

the object instance to invoke the method on

method:Method

the non-static method

args:Object[]

the method arguments (or new Object[0] if there are no args)

Returns:Object

the return value (possibly a boxed value)

Annotations
@Override
invokeStaticMethodback to summary
pack-priv Object invokeStaticMethod(final Method method, final Object... args) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeStaticMethod.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.invokeStaticMethod.

Invoke a static method, boxing the result if necessary.

Parameters
method:Method

the static method

args:Object[]

the method arguments (or new Object[0] if there are no args)

Returns:Object

the return value (possibly a boxed value)

Annotations
@Override
makeAccessibleback to summary
public boolean makeAccessible(final Object instance, final AccessibleObject accessibleObject)

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.makeAccessible.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.makeAccessible.

Make a field or method accessible.

Parameters
instance:Object

the object instance, or null if static.

accessibleObject:AccessibleObject

the field or method.

Returns:boolean

true if successful.

Annotations
@Override
setFieldback to summary
pack-priv void setField(final Object object, final Field field, final Object value) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.setField.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.setField.

Set the value of a non-static field, unboxing the value if necessary.

Parameters
object:Object

the object instance to get the field value from

field:Field

the non-static field

value:Object

the value to set

Annotations
@Override
setStaticFieldback to summary
pack-priv void setStaticField(final Field field, final Object value) throws Exception

Implements abstract nonapi.io.github.classgraph.reflection.ReflectionDriver.setStaticField.

Doc from nonapi.io.github.classgraph.reflection.ReflectionDriver.setStaticField.

Set the value of a static field, unboxing the value if necessary.

Parameters
field:Field

the static field

value:Object

the value to set

Annotations
@Override
nonapi.io.github.classgraph.reflection back to summary

private Interface JVMDriverReflectionDriver.ClassFinder


Method Summary

Modifier and TypeMethod and Description
public Class<?>
findClass(String className)

Method Detail

findClassback to summary
public Class<?> findClass(String className) throws Exception