Top Description Fields Constructors Methods
jdk.dynalink.beans

pack-priv abstract Class DynamicMethod

extends Object
Class Inheritance
Known Direct Subclasses
jdk.dynalink.beans.OverloadedDynamicMethod, jdk.dynalink.beans.SingleDynamicMethod
Imports
java.lang.invoke.MethodHandle, jdk.dynalink.CallSiteDescriptor, jdk.dynalink.linker.LinkerServices

Represents a single dynamic method. A "dynamic" method can be bound to a single Java method, or can be bound to all overloaded methods of the same name on a class. Getting an invocation of a dynamic method bound to multiple overloaded methods will perform overload resolution (actually, it will perform partial overloaded resolution at link time, but if that fails to identify exactly one target method, it will generate a method handle that will perform the rest of the overload resolution at invocation time for actual argument types).

Field Summary

Modifier and TypeField and Description
private final String

Constructor Summary

AccessConstructor and Description
pack-priv
DynamicMethod(final String name)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract boolean

Returns:

true if it already contains an equivalent method.
contains
(SingleDynamicMethod
the method to check
method
)

True if this dynamic method already contains a method with an identical signature as the passed in method.

pack-priv static String
getClassAndMethodName(final Class<?> clazz, final String name)

pack-priv abstract MethodHandle

Returns:

an invocation suitable for calling the method from the specified call site.
getInvocation
(CallSiteDescriptor
the descriptor of the call site
callSiteDescriptor
,
LinkerServices
linker services. Used for language-specific type conversions.
linkerServices
)

Creates an invocation for the dynamic method.

pack-priv abstract SingleDynamicMethod

Returns:

a single dynamic method representing a single underlying Java method, or null if none of the Java methods behind this dynamic method exactly match the requested parameter types.
getMethodForExactParamTypes
(String
the comma-separated list of requested parameter type names. The names will match both qualified and unqualified type names.
paramTypes
)

Returns a single dynamic method representing a single underlying Java method (possibly selected among several overloads) with formal parameter types exactly matching the passed signature.

pack-priv String
pack-priv boolean

Returns:

true if this represents a constructor.
isConstructor
()

True if this method happens to be a constructor method.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

nameback to summary
private final String name

Constructor Detail

DynamicMethodback to summary
pack-priv DynamicMethod(final String name)

Method Detail

containsback to summary
pack-priv abstract boolean contains(SingleDynamicMethod method)

True if this dynamic method already contains a method with an identical signature as the passed in method.

Parameters
method:SingleDynamicMethod

the method to check

Returns:boolean

true if it already contains an equivalent method.

getClassAndMethodNameback to summary
pack-priv static String getClassAndMethodName(final Class<?> clazz, final String name)
getInvocationback to summary
pack-priv abstract MethodHandle getInvocation(CallSiteDescriptor callSiteDescriptor, LinkerServices linkerServices)

Creates an invocation for the dynamic method. If the method is overloaded, it will perform overloaded method resolution based on the specified method type. The resulting resolution can either identify a single method to be invoked among the overloads, or it can identify multiple ones. In the latter case, the returned method handle will perform further overload resolution among these candidates at every invocation. If the method to be invoked is a variable arguments (vararg) method, it will pack the extra arguments in an array before the invocation of the underlying method if it is not already done.

Parameters
callSiteDescriptor:CallSiteDescriptor

the descriptor of the call site

linkerServices:LinkerServices

linker services. Used for language-specific type conversions.

Returns:MethodHandle

an invocation suitable for calling the method from the specified call site.

getMethodForExactParamTypesback to summary
pack-priv abstract SingleDynamicMethod getMethodForExactParamTypes(String paramTypes)

Returns a single dynamic method representing a single underlying Java method (possibly selected among several overloads) with formal parameter types exactly matching the passed signature.

Parameters
paramTypes:String

the comma-separated list of requested parameter type names. The names will match both qualified and unqualified type names.

Returns:SingleDynamicMethod

a single dynamic method representing a single underlying Java method, or null if none of the Java methods behind this dynamic method exactly match the requested parameter types.

getNameback to summary
pack-priv String getName()
isConstructorback to summary
pack-priv boolean isConstructor()

True if this method happens to be a constructor method.

Returns:boolean

true if this represents a constructor.

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.

Returns:String

a string representation of the object

Annotations
@Override