APIdia Launch Partner
Top Description Fields Constructors Methods
java.lang.constant

public final Class DynamicCallSiteDesc

extends Object
Class Inheritance
Imports
java.lang.invoke.CallSite, .MethodHandle, .MethodHandles, java.util.Arrays, .Objects, java.util.stream.Stream

A nominal descriptor for an invokedynamic call site.

A DynamicCallSiteDesc is immutable and its behavior does not rely on object identity.

Since
12

Field Summary

Modifier and TypeField and Description
private final ConstantDesc[]
private final DirectMethodHandleDesc
private final String
private final MethodTypeDesc

Constructor Summary

AccessConstructor and Description
private
DynamicCallSiteDesc(DirectMethodHandleDesc
a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic
bootstrapMethod
,
String
The unqualified name that would appear in the NameAndType operand of the invokedynamic
invocationName
,
MethodTypeDesc
a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
invocationType
,
ConstantDesc[]
ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute
bootstrapArgs
)

Creates a nominal descriptor for an invokedynamic call site.

Method Summary

Modifier and TypeMethod and Description
public ConstantDesc[]

Returns:

the bootstrap arguments for the invokedynamic
bootstrapArgs
()

Returns ConstantDescs describing the bootstrap arguments for the invokedynamic.

public MethodHandleDesc

Returns:

the bootstrap method for the invokedynamic
bootstrapMethod
()

Returns a MethodHandleDesc describing the bootstrap method for the invokedynamic.

public final boolean

Returns:

true if the specified DynamicCallSiteDesc is equal to this DynamicCallSiteDesc.
equals
(Object
the DynamicCallSiteDesc to compare to this DynamicCallSiteDesc
o
)

Overrides java.lang.Object.equals.

Compares the specified object with this descriptor for equality.

public final int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public String

Returns:

the invocation name
invocationName
()

Returns the invocation name that would appear in the NameAndType operand of the invokedynamic.

public MethodTypeDesc

Returns:

the invocation type
invocationType
()

Returns a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic.

public static DynamicCallSiteDesc

Returns:

the nominal descriptor
of
(DirectMethodHandleDesc
a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic
bootstrapMethod
,
String
The unqualified name that would appear in the NameAndType operand of the invokedynamic
invocationName
,
MethodTypeDesc
a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
invocationType
,
ConstantDesc...
ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute
bootstrapArgs
)

Creates a nominal descriptor for an invokedynamic call site.

public static DynamicCallSiteDesc

Returns:

the nominal descriptor
of
(DirectMethodHandleDesc
The bootstrap method for the invokedynamic
bootstrapMethod
,
String
The invocationName that would appear in the NameAndType operand of the invokedynamic
invocationName
,
MethodTypeDesc
The invocation invocationType that would appear in the NameAndType operand of the invokedynamic
invocationType
)

Creates a nominal descriptor for an invokedynamic call site whose bootstrap method has no static arguments.

public static DynamicCallSiteDesc

Returns:

the nominal descriptor
of
(DirectMethodHandleDesc
a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic
bootstrapMethod
,
MethodTypeDesc
a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
invocationType
)

Creates a nominal descriptor for an invokedynamic call site whose bootstrap method has no static arguments and for which the name parameter is ConstantDescs#DEFAULT_NAME.

public CallSite

Returns:

the CallSite
resolveCallSiteDesc
(MethodHandles.Lookup
The MethodHandles.Lookup used to resolve class names
lookup
)

Reflectively invokes the bootstrap method with the specified arguments, and return the resulting CallSite

public String

Returns:

A compact textual description of this call site descriptor
toString
()

Overrides java.lang.Object.toString.

Returns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.

public DynamicCallSiteDesc

Returns:

the nominal descriptor
withArgs
(ConstantDesc...
ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute
bootstrapArgs
)

Returns a nominal descriptor for an invokedynamic call site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.

public DynamicCallSiteDesc

Returns:

the nominal descriptor
withNameAndType
(String
The unqualified name that would appear in the NameAndType operand of the invokedynamic
invocationName
,
MethodTypeDesc
a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic
invocationType
)

Returns a nominal descriptor for an invokedynamic call site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationType

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

bootstrapArgsback to summary
private final ConstantDesc[] bootstrapArgs
bootstrapMethodback to summary
private final DirectMethodHandleDesc bootstrapMethod
invocationNameback to summary
private final String invocationName
invocationTypeback to summary
private final MethodTypeDesc invocationType

Constructor Detail

DynamicCallSiteDescback to summary
private DynamicCallSiteDesc(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc[] bootstrapArgs)

Creates a nominal descriptor for an invokedynamic call site.

Parameters
bootstrapMethod:DirectMethodHandleDesc

a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic

invocationName:String

The unqualified name that would appear in the NameAndType operand of the invokedynamic

invocationType:MethodTypeDesc

a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic

bootstrapArgs:ConstantDesc[]

ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute

Exceptions
NullPointerException:
if any parameter or its contents are null
IllegalArgumentException:
if the invocation name has the incorrect format
Java Virtual Machine Specification
4.2.2 Unqualified Names

Method Detail

bootstrapArgsback to summary
public ConstantDesc[] bootstrapArgs()

Returns ConstantDescs describing the bootstrap arguments for the invokedynamic. The returned array is always non-null. A zero length array is returned if this DynamicCallSiteDesc has no bootstrap arguments.

Returns:ConstantDesc[]

the bootstrap arguments for the invokedynamic

bootstrapMethodback to summary
public MethodHandleDesc bootstrapMethod()

Returns a MethodHandleDesc describing the bootstrap method for the invokedynamic.

Returns:MethodHandleDesc

the bootstrap method for the invokedynamic

equalsback to summary
public final boolean equals(Object o)

Overrides java.lang.Object.equals.

Compares the specified object with this descriptor for equality. Returns true if and only if the specified object is also a DynamicCallSiteDesc, and both descriptors have equal bootstrap methods, bootstrap argument lists, invocation name, and invocation type.

Parameters
o:Object

the DynamicCallSiteDesc to compare to this DynamicCallSiteDesc

Returns:boolean

true if the specified DynamicCallSiteDesc is equal to this DynamicCallSiteDesc.

Annotations
@Override
hashCodeback to summary
public final 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.
Annotations
@Override
invocationNameback to summary
public String invocationName()

Returns the invocation name that would appear in the NameAndType operand of the invokedynamic.

Returns:String

the invocation name

invocationTypeback to summary
public MethodTypeDesc invocationType()

Returns a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic.

Returns:MethodTypeDesc

the invocation type

ofback to summary
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)

Creates a nominal descriptor for an invokedynamic call site.

Parameters
bootstrapMethod:DirectMethodHandleDesc

a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic

invocationName:String

The unqualified name that would appear in the NameAndType operand of the invokedynamic

invocationType:MethodTypeDesc

a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic

bootstrapArgs:ConstantDesc[]

ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute

Returns:DynamicCallSiteDesc

the nominal descriptor

Exceptions
NullPointerException:
if any parameter or its contents are null
IllegalArgumentException:
if the invocation name has the incorrect format
Java Virtual Machine Specification
4.2.2 Unqualified Names
ofback to summary
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType)

Creates a nominal descriptor for an invokedynamic call site whose bootstrap method has no static arguments.

Parameters
bootstrapMethod:DirectMethodHandleDesc

The bootstrap method for the invokedynamic

invocationName:String

The invocationName that would appear in the NameAndType operand of the invokedynamic

invocationType:MethodTypeDesc

The invocation invocationType that would appear in the NameAndType operand of the invokedynamic

Returns:DynamicCallSiteDesc

the nominal descriptor

Exceptions
NullPointerException:
if any parameter is null
IllegalArgumentException:
if the invocation name has the incorrect format
ofback to summary
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType)

Creates a nominal descriptor for an invokedynamic call site whose bootstrap method has no static arguments and for which the name parameter is ConstantDescs#DEFAULT_NAME.

Parameters
bootstrapMethod:DirectMethodHandleDesc

a DirectMethodHandleDesc describing the bootstrap method for the invokedynamic

invocationType:MethodTypeDesc

a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic

Returns:DynamicCallSiteDesc

the nominal descriptor

Exceptions
NullPointerException:
if any parameter is null
resolveCallSiteDescback to summary
public CallSite resolveCallSiteDesc(MethodHandles.Lookup lookup) throws Throwable

Reflectively invokes the bootstrap method with the specified arguments, and return the resulting CallSite

Parameters
lookup:MethodHandles.Lookup

The MethodHandles.Lookup used to resolve class names

Returns:CallSite

the CallSite

Exceptions
Throwable:
if any exception is thrown by the bootstrap method
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Returns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.

Returns:String

A compact textual description of this call site descriptor

Annotations
@Override
withArgsback to summary
public DynamicCallSiteDesc withArgs(ConstantDesc... bootstrapArgs)

Returns a nominal descriptor for an invokedynamic call site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.

Parameters
bootstrapArgs:ConstantDesc[]

ConstantDescs describing the static arguments to the bootstrap, that would appear in the BootstrapMethods attribute

Returns:DynamicCallSiteDesc

the nominal descriptor

Exceptions
NullPointerException:
if the argument or its contents are null
withNameAndTypeback to summary
public DynamicCallSiteDesc withNameAndType(String invocationName, MethodTypeDesc invocationType)

Returns a nominal descriptor for an invokedynamic call site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationType

Parameters
invocationName:String

The unqualified name that would appear in the NameAndType operand of the invokedynamic

invocationType:MethodTypeDesc

a MethodTypeDesc describing the invocation type that would appear in the NameAndType operand of the invokedynamic

Returns:DynamicCallSiteDesc

the nominal descriptor

Exceptions
NullPointerException:
if any parameter is null
IllegalArgumentException:
if the invocation name has the incorrect format
Java Virtual Machine Specification
4.2.2 Unqualified Names