APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.dynalink.beans

pack-priv Class AccessibleMembersLookup

extends Object
Class Inheritance
Imports
java.lang.reflect.Method, .Modifier, java.util.Arrays, .Collection, .HashMap, .LinkedHashMap, .Map

Utility class for discovering accessible methods and inner classes. Normally, a public member declared on a class is accessible (that is, it can be invoked from anywhere). However, this is not the case if the class itself is not public, or belongs to a restricted-access package. In that case, it is required to lookup a member in a publicly accessible superclass or implemented interface of the class, and use it instead of the member discovered on the class.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static class
AccessibleMembersLookup.MethodSignature

A helper class that represents a method signature - name and argument types.

Field Summary

Modifier and TypeField and Description
private final Map<String, Class<?>>
private final boolean
private final Map<AccessibleMembersLookup.MethodSignature, Method>

Constructor Summary

AccessConstructor and Description
pack-priv
AccessibleMembersLookup(final Class<?>
the inspected class
clazz
,
final boolean
true to inspect instance methods, false to inspect static methods.
instance
)

Creates a mapping for all accessible methods and inner classes on a class.

Method Summary

Modifier and TypeMethod and Description
pack-priv Method
pack-priv Class<?>[]
pack-priv Collection<Method>
private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

innerClassesback to summary
private final Map<String, Class<?>> innerClasses
instanceback to summary
private final boolean instance
methodsback to summary
private final Map<AccessibleMembersLookup.MethodSignature, Method> methods

Constructor Detail

AccessibleMembersLookupback to summary
pack-priv AccessibleMembersLookup(final Class<?> clazz, final boolean instance)

Creates a mapping for all accessible methods and inner classes on a class.

Parameters
clazz:Class<?>

the inspected class

instance:boolean

true to inspect instance methods, false to inspect static methods.

Method Detail

getAccessibleMethodback to summary
pack-priv Method getAccessibleMethod(final Method m)
getInnerClassesback to summary
pack-priv Class<?>[] getInnerClasses()
getMethodsback to summary
pack-priv Collection<Method> getMethods()
lookupAccessibleMembersback to summary
private void lookupAccessibleMembers(final Class<?> clazz)
jdk.dynalink.beans back to summary

pack-priv final Class AccessibleMembersLookup.MethodSignature

extends Object
Class Inheritance

A helper class that represents a method signature - name and argument types.

Field Summary

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

Constructor Summary

AccessConstructor and Description
pack-priv
MethodSignature(final String
the name of the method this signature represents.
name
,
final Class<?>[]
the argument types of the method.
args
)

Creates a new method signature from arbitrary data.

pack-priv
MethodSignature(final Method
the method for which a signature is created.
method
)

Creates a signature for the given method.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the other object is also a method signature with the same name, same number of arguments, and same types of arguments.
equals
(final Object
the other object
o
)

Overrides java.lang.Object.equals.

Compares this object to another object

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code, consistent with the overridden equals(Object).

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

argsback to summary
private final Class<?>[] args
nameback to summary
private final String name

Constructor Detail

MethodSignatureback to summary
pack-priv MethodSignature(final String name, final Class<?>[] args)

Creates a new method signature from arbitrary data.

Parameters
name:String

the name of the method this signature represents.

args:Class<?>[]

the argument types of the method.

MethodSignatureback to summary
pack-priv MethodSignature(final Method method)

Creates a signature for the given method.

Parameters
method:Method

the method for which a signature is created.

Method Detail

equalsback to summary
public boolean equals(final Object o)

Overrides java.lang.Object.equals.

Compares this object to another object

Parameters
o:Object

the other object

Returns:boolean

true if the other object is also a method signature with the same name, same number of arguments, and same types of arguments.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code, consistent with the overridden equals(Object).

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override