public interface Reflection
| Modifier and Type | Method and Description |
|---|---|
Class<?> |
defineClass(String name,
byte[] data)
Allows you to initialize a class with the correct name
and automatically load it into runtime in SystemClassLoader loader
|
Object |
godInvoke(Method method,
Object o,
Object... args)
Allows you to call invoke on an instance of a method with all privileges
|
boolean |
isClassPresents(String className,
ClassLoader loader)
Checks whether the class is loaded in the specified class loader
|
sun.misc.Unsafe |
lookup() |
void |
redefineClassLoader(Class<?> clazz,
ClassLoader loader)
Allows you to change the class loader of the specified class to any other loader
|
void |
unlockNative(Method method)
Fixes a problem with calling a method that
contains a native keyword via the Java Reflection API
|
sun.misc.Unsafe lookup()
void unlockNative(Method method)
method - The method to perform onClass<?> defineClass(String name, byte[] data) throws NoSuchMethodException, InvocationTargetException, IllegalAccessException
name - Correct class namedata - Correct class byte dataNoSuchMethodException - This error cannot be thrown, but it will have to be handled (because I am pussy)InvocationTargetException - If the data or name is incorrect (check docs before using this method)IllegalAccessException - This error cannot be thrown, but it will have to be handled (because I am pussy)boolean isClassPresents(String className, ClassLoader loader)
className - Class name to checkloader - Exact class loadervoid redefineClassLoader(Class<?> clazz, ClassLoader loader)
clazz - Exact classloader - Exact class loaderObject godInvoke(Method method, Object o, Object... args) throws InvocationTargetException, IllegalAccessException
method - The method to be executedo - The object the underlying method is invoked fromargs - The arguments used for the method callInvocationTargetException - If the underlying method throws an exceptionIllegalAccessException - If this Method object is enforcing Java language access control and the underlying method is inaccessibleCopyright © 2022. All rights reserved.