Class DynamicCallSiteDesc
java.lang.Object
java.lang.constant.DynamicCallSiteDesc
A nominal descriptor for an
invokedynamic call site.
A DynamicCallSiteDesc is immutable and its behavior does not
rely on object identity.
- Since:
- 12
-
Method Summary
Modifier and TypeMethodDescriptionReturnsConstantDescs describing the bootstrap arguments for theinvokedynamic.Returns aMethodHandleDescdescribing the bootstrap method for theinvokedynamic.final booleanCompares the specified object with this descriptor for equality.final inthashCode()Answers an integer hash code for the receiver.Returns the invocation name that would appear in theNameAndTypeoperand of theinvokedynamic.Returns aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamic.static DynamicCallSiteDescof(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType) Creates a nominal descriptor for aninvokedynamiccall site whose bootstrap method has no static arguments and for which the name parameter isConstantDescs.DEFAULT_NAME.static DynamicCallSiteDescof(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType) Creates a nominal descriptor for aninvokedynamiccall site whose bootstrap method has no static arguments.static DynamicCallSiteDescof(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs) Creates a nominal descriptor for aninvokedynamiccall site.Reflectively invokes the bootstrap method with the specified arguments, and return the resultingCallSitetoString()Returns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.withArgs(ConstantDesc... bootstrapArgs) Returns a nominal descriptor for aninvokedynamiccall site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.withNameAndType(String invocationName, MethodTypeDesc invocationType) Returns a nominal descriptor for aninvokedynamiccall site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationTypeMethods declared in class Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
of
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs) Creates a nominal descriptor for aninvokedynamiccall site.- Parameters:
bootstrapMethod- aDirectMethodHandleDescdescribing the bootstrap method for theinvokedynamicinvocationName- The unqualified name that would appear in theNameAndTypeoperand of theinvokedynamicinvocationType- aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamicbootstrapArgs-ConstantDescs describing the static arguments to the bootstrap, that would appear in theBootstrapMethodsattribute- Returns:
- the nominal descriptor
- Throws:
NullPointerException- if any parameter or its contents arenullIllegalArgumentException- if the invocation name has the incorrect format- See Java Virtual Machine Specification:
-
4.2.2 Unqualified Names
-
of
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType) Creates a nominal descriptor for aninvokedynamiccall site whose bootstrap method has no static arguments.- Parameters:
bootstrapMethod- The bootstrap method for theinvokedynamicinvocationName- The invocationName that would appear in theNameAndTypeoperand of theinvokedynamicinvocationType- The invocation invocationType that would appear in theNameAndTypeoperand of theinvokedynamic- Returns:
- the nominal descriptor
- Throws:
NullPointerException- if any parameter is nullIllegalArgumentException- if the invocation name has the incorrect format
-
of
public static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, MethodTypeDesc invocationType) Creates a nominal descriptor for aninvokedynamiccall site whose bootstrap method has no static arguments and for which the name parameter isConstantDescs.DEFAULT_NAME.- Parameters:
bootstrapMethod- aDirectMethodHandleDescdescribing the bootstrap method for theinvokedynamicinvocationType- aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamic- Returns:
- the nominal descriptor
- Throws:
NullPointerException- if any parameter is null
-
withArgs
Returns a nominal descriptor for aninvokedynamiccall site whose bootstrap method, name, and invocation type are the same as this one, but with the specified bootstrap arguments.- Parameters:
bootstrapArgs-ConstantDescs describing the static arguments to the bootstrap, that would appear in theBootstrapMethodsattribute- Returns:
- the nominal descriptor
- Throws:
NullPointerException- if the argument or its contents arenull
-
withNameAndType
Returns a nominal descriptor for aninvokedynamiccall site whose bootstrap and bootstrap arguments are the same as this one, but with the specified invocationName and invocation invocationType- Parameters:
invocationName- The unqualified name that would appear in theNameAndTypeoperand of theinvokedynamicinvocationType- aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamic- Returns:
- the nominal descriptor
- Throws:
NullPointerException- if any parameter is nullIllegalArgumentException- if the invocation name has the incorrect format- See Java Virtual Machine Specification:
-
4.2.2 Unqualified Names
-
invocationName
Returns the invocation name that would appear in theNameAndTypeoperand of theinvokedynamic.- Returns:
- the invocation name
-
invocationType
Returns aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamic.- Returns:
- the invocation type
-
bootstrapMethod
Returns aMethodHandleDescdescribing the bootstrap method for theinvokedynamic.- Returns:
- the bootstrap method for the
invokedynamic
-
bootstrapArgs
ReturnsConstantDescs describing the bootstrap arguments for theinvokedynamic. The returned array is always non-null. A zero length array is returned if this DynamicCallSiteDesc has no bootstrap arguments.- Returns:
- the bootstrap arguments for the
invokedynamic
-
resolveCallSiteDesc
Reflectively invokes the bootstrap method with the specified arguments, and return the resultingCallSite- Parameters:
lookup- TheMethodHandles.Lookupused to resolve class names- Returns:
- the
CallSite - Throws:
Throwable- if any exception is thrown by the bootstrap method
-
equals
Compares the specified object with this descriptor for equality. Returnstrueif 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. -
hashCode
-
toString
-