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

pack-priv Class SimpleDynamicMethod

extends SingleDynamicMethod
Class Inheritance
Imports
java.lang.invoke.MethodHandle, .MethodType, jdk.dynalink.CallSiteDescriptor

A dynamic method bound to exactly one Java method or constructor that is not caller sensitive. Since its target is not caller sensitive, this class pre-caches its method handle and always returns it from the call to getTarget(CallSiteDescriptor). Can be used in general to represents dynamic methods bound to a single method handle, even if that handle is not mapped to a Java method, i.e. as a wrapper around field getters/setters, array element getters/setters, etc.

Field Summary

Modifier and TypeField and Description
private final boolean
private final MethodHandle

Constructor Summary

AccessConstructor and Description
pack-priv
SimpleDynamicMethod(final MethodHandle
the target method handle
target
,
final Class<?>
the class declaring the method
clazz
,
final String
the simple name of the method
name
)

Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle signature.

pack-priv
SimpleDynamicMethod(final MethodHandle
the target method handle
target
,
final Class<?>
the class declaring the method
clazz
,
final String
the simple name of the method
name
,
final boolean
does this represent a constructor?
constructor
)

Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle signature.

Method Summary

Modifier and TypeMethod and Description
pack-priv MethodType
getMethodType()

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.getMethodType.

Returns this method's native type.

private static String
getName(final MethodHandle target, final Class<?> clazz, final String name, final boolean constructor)

pack-priv MethodHandle
getTarget(final CallSiteDescriptor desc)

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.getTarget.

Given a specified call site descriptor, returns a method handle to this method's target.

pack-priv boolean
isConstructor()

Overrides jdk.dynalink.beans.DynamicMethod.isConstructor.

True if this method happens to be a constructor method.

pack-priv boolean
isVarArgs()

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.isVarArgs.

Returns true if this method is variable arity.

Inherited from jdk.dynalink.beans.SingleDynamicMethod:
collectArgumentscontainsgetInvocationgetInvocationgetMethodForExactParamTypesgetMethodNameWithSignature

Field Detail

constructorback to summary
private final boolean constructor
targetback to summary
private final MethodHandle target

Constructor Detail

SimpleDynamicMethodback to summary
pack-priv SimpleDynamicMethod(final MethodHandle target, final Class<?> clazz, final String name)

Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle signature.

Parameters
target:MethodHandle

the target method handle

clazz:Class<?>

the class declaring the method

name:String

the simple name of the method

SimpleDynamicMethodback to summary
pack-priv SimpleDynamicMethod(final MethodHandle target, final Class<?> clazz, final String name, final boolean constructor)

Creates a new simple dynamic method, with a name constructed from the class name, method name, and handle signature.

Parameters
target:MethodHandle

the target method handle

clazz:Class<?>

the class declaring the method

name:String

the simple name of the method

constructor:boolean

does this represent a constructor?

Method Detail

getMethodTypeback to summary
pack-priv MethodType getMethodType()

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.getMethodType.

Doc from jdk.dynalink.beans.SingleDynamicMethod.getMethodType.

Returns this method's native type.

Annotations
@Override
getNameback to summary
private static String getName(final MethodHandle target, final Class<?> clazz, final String name, final boolean constructor)
getTargetback to summary
pack-priv MethodHandle getTarget(final CallSiteDescriptor desc)

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.getTarget.

Doc from jdk.dynalink.beans.SingleDynamicMethod.getTarget.

Given a specified call site descriptor, returns a method handle to this method's target. The target should only depend on the descriptor's lookup, and it should only retrieve it (as a privileged operation) when it is absolutely needed.

Annotations
@Override
isConstructorback to summary
pack-priv boolean isConstructor()

Overrides jdk.dynalink.beans.DynamicMethod.isConstructor.

Doc from jdk.dynalink.beans.DynamicMethod.isConstructor.

True if this method happens to be a constructor method.

Annotations
@Override
isVarArgsback to summary
pack-priv boolean isVarArgs()

Implements abstract jdk.dynalink.beans.SingleDynamicMethod.isVarArgs.

Doc from jdk.dynalink.beans.SingleDynamicMethod.isVarArgs.

Returns true if this method is variable arity.

Annotations
@Override