APIdia Launch Partner
Top Fields Constructors Methods
sun.reflect.misc

public final Class MethodUtil

Additional top-level class in compilation unit: Trampoline.

extends SecureClassLoader
Class Inheritance
Imports
java.io.IOException, .InputStream, java.lang.reflect.InvocationTargetException, .Method, java.security.AccessController, .AllPermission, .CodeSource, .PermissionCollection, .PrivilegedExceptionAction, .SecureClassLoader

Field Summary

Modifier and TypeField and Description
private static final Method
private static final String
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private Class<?>
defineClass(String name, byte[] b)

protected Class<?>
findClass(final String name)

Overrides java.lang.ClassLoader.findClass.

Finds the class with the specified binary name.

public static Method
getMethod(Class<?> cls, String name, Class<?>[] args)

protected PermissionCollection
getPermissions(CodeSource codesource)

Overrides java.security.SecureClassLoader.getPermissions.

Returns the permissions for the given CodeSource object.

private static Method
private static Class<?>
public static Object
invoke(Method m, Object obj, Object[] params)

protected synchronized Class<?>
loadClass(String name, boolean resolve)

Overrides java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name.

Inherited from java.security.SecureClassLoader:
defineClassdefineClass

Field Detail

bounceback to summary
private static final Method bounce
MISC_PKGback to summary
private static final String MISC_PKG
TRAMPOLINEback to summary
private static final String TRAMPOLINE

Constructor Detail

MethodUtilback to summary
private MethodUtil()

Method Detail

defineClassback to summary
private Class<?> defineClass(String name, byte[] b) throws IOException
findClassback to summary
protected Class<?> findClass(final String name) throws ClassNotFoundException

Overrides java.lang.ClassLoader.findClass.

Doc from java.lang.ClassLoader.findClass.

Finds the class with the specified binary name. This method should be overridden by class loader implementations that follow the delegation model for loading classes, and will be invoked by the loadClass method after checking the parent class loader for the requested class.

Exceptions
ClassNotFoundException:
If the class could not be found
getMethodback to summary
public static Method getMethod(Class<?> cls, String name, Class<?>[] args) throws NoSuchMethodException
getPermissionsback to summary
protected PermissionCollection getPermissions(CodeSource codesource)

Overrides java.security.SecureClassLoader.getPermissions.

Doc from java.security.SecureClassLoader.getPermissions.

Returns the permissions for the given CodeSource object.

This method is invoked by the defineClass method which takes a CodeSource as an argument when it is constructing the ProtectionDomain for the class being defined.

getTrampolineback to summary
private static Method getTrampoline()
Annotations
@SuppressWarnings:removal
getTrampolineClassback to summary
private static Class<?> getTrampolineClass()
invokeback to summary
public static Object invoke(Method m, Object obj, Object[] params) throws InvocationTargetException, IllegalAccessException
loadClassback to summary
protected synchronized Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException

Overrides java.lang.ClassLoader.loadClass.

Doc from java.lang.ClassLoader.loadClass.

Loads the class with the specified binary name. The default implementation of this method searches for classes in the following order:

  1. Invoke findLoadedClass(String) to check if the class has already been loaded.

  2. Invoke the loadClass method on the parent class loader. If the parent is null the class loader built into the virtual machine is used, instead.

  3. Invoke the findClass(String) method to find the class.

If the class was found using the above steps, and the resolve flag is true, this method will then invoke the resolveClass(Class) method on the resulting Class object.

Subclasses of ClassLoader are encouraged to override findClass(String), rather than this method.

Unless overridden, this method synchronizes on the result of getClassLoadingLock method during the entire class loading process.

Exceptions
ClassNotFoundException:
If the class could not be found