java.lang.Object
java.lang.constant.DynamicCallSiteDesc
public class DynamicCallSiteDesc extends Object
A nominal descriptor for an
 
invokedynamic call site.
 Concrete subtypes of DynamicCallSiteDesc must be value-based.
- Since:
- 12
- 
Method SummaryModifier and Type Method Description ConstantDesc[]bootstrapArgs()ReturnsConstantDescs describing the bootstrap arguments for theinvokedynamic.MethodHandleDescbootstrapMethod()Returns aMethodHandleDescdescribing the bootstrap method for theinvokedynamic.booleanequals(Object o)Compares the specified object with this descriptor for equality.StringinvocationName()Returns the invocation name that would appear in theNameAndTypeoperand of theinvokedynamic.MethodTypeDescinvocationType()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.CallSiteresolveCallSiteDesc(MethodHandles.Lookup lookup)Reflectively invokes the bootstrap method with the specified arguments, and return the resultingCallSiteStringtoString()Returns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.DynamicCallSiteDescwithArgs(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.DynamicCallSiteDescwithNameAndType(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 invocationType
- 
Method Details- 
ofpublic static DynamicCallSiteDesc of(DirectMethodHandleDesc bootstrapMethod, String invocationName, MethodTypeDesc invocationType, ConstantDesc... bootstrapArgs)Creates a nominal descriptor for aninvokedynamiccall site.- Parameters:
- bootstrapMethod- a- DirectMethodHandleDescdescribing the bootstrap method for the- invokedynamic
- invocationName- The unqualified name that would appear in the- NameAndTypeoperand of the- invokedynamic
- invocationType- a- MethodTypeDescdescribing the invocation type that would appear in the- NameAndTypeoperand of the- invokedynamic
- bootstrapArgs-- ConstantDescs describing the static arguments to the bootstrap, that would appear in the- BootstrapMethodsattribute
- Returns:
- the nominal descriptor
- Throws:
- NullPointerException- if any parameter is null
- IllegalArgumentException- if the invocation name has the incorrect format
- See Java Virtual Machine Specification:
- 
4.2.2 Unqualified Names
 
- 
ofpublic 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 the- invokedynamic
- invocationName- The invocationName that would appear in the- NameAndTypeoperand of the- invokedynamic
- invocationType- The invocation invocationType that would appear in the- NameAndTypeoperand of the- invokedynamic
- Returns:
- the nominal descriptor
- Throws:
- NullPointerException- if any parameter is null
- IllegalArgumentException- if the invocation name has the incorrect format
 
- 
ofpublic 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- a- DirectMethodHandleDescdescribing the bootstrap method for the- invokedynamic
- invocationType- a- MethodTypeDescdescribing the invocation type that would appear in the- NameAndTypeoperand of the- invokedynamic
- Returns:
- the nominal descriptor
- Throws:
- NullPointerException- if any parameter is null
 
- 
withArgsReturns 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 the- BootstrapMethodsattribute
- Returns:
- the nominal descriptor
- Throws:
- NullPointerException- if any parameter is null
 
- 
withNameAndTypeReturns 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 the- NameAndTypeoperand of the- invokedynamic
- invocationType- a- MethodTypeDescdescribing the invocation type that would appear in the- NameAndTypeoperand of the- invokedynamic
- Returns:
- the nominal descriptor
- Throws:
- NullPointerException- if any parameter is null
- IllegalArgumentException- if the invocation name has the incorrect format
- See Java Virtual Machine Specification:
- 
4.2.2 Unqualified Names
 
- 
invocationNameReturns the invocation name that would appear in theNameAndTypeoperand of theinvokedynamic.- Returns:
- the invocation name
 
- 
invocationTypeReturns aMethodTypeDescdescribing the invocation type that would appear in theNameAndTypeoperand of theinvokedynamic.- Returns:
- the invocation type
 
- 
bootstrapMethodReturns aMethodHandleDescdescribing the bootstrap method for theinvokedynamic.- Returns:
- the bootstrap method for the invokedynamic
 
- 
bootstrapArgsReturnsConstantDescs 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
 
- 
resolveCallSiteDescReflectively invokes the bootstrap method with the specified arguments, and return the resultingCallSite- Parameters:
- lookup- The- MethodHandles.Lookupused to resolve class names
- Returns:
- the CallSite
- Throws:
- Throwable- if any exception is thrown by the bootstrap method
 
- 
equalsCompares 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.- Overrides:
- equalsin class- Object
- Parameters:
- o- the- DynamicCallSiteDescto compare to this- DynamicCallSiteDesc
- Returns:
- trueif the specified- DynamicCallSiteDescis equals to this- DynamicCallSiteDesc.
- See Also:
- Object.hashCode(),- HashMap
 
- 
toStringReturns a compact textual description of this call site description, including the bootstrap method, the invocation name and type, and the static bootstrap arguments.
 
-