Top Inners Fields Constructors Methods
com.sun.javafx.reflect

public final Class MethodUtil

Additional top-level class in compilation unit: Trampoline.

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
MethodUtil.Signature

A class that represents the unique elements of a method that will be a key in the method cache.

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 static void
private Class<?>
defineClass(String name, byte[] b)

protected Class<?>
findClass(final String
The binary name of the class
name
)

Overrides java.lang.ClassLoader.findClass.

Finds the class with the specified binary name.

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

public static Method[]
getMethods(Class<?> cls)

protected PermissionCollection
getPermissions(CodeSource
the codesource.
codesource
)

Overrides java.security.SecureClassLoader.getPermissions.

Returns the permissions for the given CodeSource object.

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

protected synchronized Class<?>
loadClass(String
The binary name of the class
name
,
boolean
If true then resolve the class
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

addMethodback to summary
private static void addMethod(Map<MethodUtil.Signature, Method> sigs, Method method)
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.

Parameters
name:String

The binary name of the class

Returns:Class<?>

The resulting Class object

Annotations
@Override
Exceptions
ClassNotFoundException:
If the class could not be found
getInterfaceMethodsback to summary
private static void getInterfaceMethods(Class<?> cls, Map<MethodUtil.Signature, Method> sigs)
getInternalPublicMethodsback to summary
private static boolean getInternalPublicMethods(Class<?> cls, Map<MethodUtil.Signature, Method> sigs)
getMethodback to summary
public static Method getMethod(Class<?> cls, String name, Class<?>[] args) throws NoSuchMethodException
getMethodsback to summary
public static Method[] getMethods(Class<?> cls)
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.

Parameters
codesource:CodeSource

the codesource.

Returns:PermissionCollection

the permissions granted to the codesource.

Annotations
@Override
getPublicMethodsback to summary
pack-priv static Method[] getPublicMethods(Class<?> cls)
Annotations
@SuppressWarnings:removal
getTrampolineback to summary
private static Method getTrampoline()
Annotations
@SuppressWarnings:removal
getTrampolineClassback to summary
private static Class<?> getTrampolineClass()
getTrampolineModuleback to summary
public static Module getTrampolineModule()
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.

Parameters
name:String

The binary name of the class

resolve:boolean

If true then resolve the class

Returns:Class<?>

The resulting Class object

Annotations
@Override
Exceptions
ClassNotFoundException:
If the class could not be found
com.sun.javafx.reflect back to summary

private Class MethodUtil.Signature

extends Object
Class Inheritance

A class that represents the unique elements of a method that will be a key in the method cache.

Field Summary

Modifier and TypeField and Description
private final Class<?>[]
private final int
private final String

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public boolean
equals(Object
the reference object with which to compare.
o2
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

argClassesback to summary
private final Class<?>[] argClasses
hashCodeback to summary
private final int hashCode
methodNameback to summary
private final String methodName

Constructor Detail

Signatureback to summary
pack-priv Signature(Method m)

Method Detail

equalsback to summary
public boolean equals(Object o2)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o2:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override