-
- All Superinterfaces:
-
ConstantGroup
public interface BootstrapCallInfo<T> extends ConstantGroup
An interface providing full static information about a particular call to a bootstrap method of an dynamic call site or dynamic constant. This information include the method itself, the associated name and type, and any associated static arguments.If a bootstrap method declares exactly two arguments, and is not of variable arity, then it is fed only two arguments by the JVM, the
lookup object
and an instance ofBootstrapCallInfo
which supplies the rest of the information about the call.The API for accessing the static arguments allows the bootstrap method to reorder the resolution (in the constant pool) of the static arguments, and to catch errors resulting from the resolution. This mode of evaluation pulls bootstrap parameters from the JVM under control of the bootstrap method, as opposed to the JVM pushing parameters to a bootstrap method by resolving them all before the bootstrap method is called.
- API Note:
-
The
lookup object
is not included in this bundle of information, so as not to obscure the access control logic of the program. In cases where there are many thousands of parameters, it may be preferable to pull their resolved values, either singly or in batches, rather than wait until all of them have been resolved before a constant or call site can be used. - Since:
- 1.10
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description MethodHandle
bootstrapMethod()
Returns the bootstrap method for this call.String
invocationName()
Returns the method name or constant name for this call.T
invocationType()
Returns the method type or constant type for this call.static <T> BootstrapCallInfo<T>
makeBootstrapCallInfo(MethodHandle bsm, String name, T type, ConstantGroup constants)
Make a new bootstrap call descriptor with the given components.-
Methods inherited from interface java.lang.invoke.ConstantGroup
asList, asList, copyConstants, copyConstants, get, get, isPresent, makeConstantGroup, size, subGroup
-
-
-
-
Method Detail
-
bootstrapMethod
MethodHandle bootstrapMethod()
Returns the bootstrap method for this call.- Returns:
- the bootstrap method
-
invocationName
String invocationName()
Returns the method name or constant name for this call.- Returns:
- the method name or constant name
-
invocationType
T invocationType()
Returns the method type or constant type for this call.- Returns:
- the method type or constant type
-
makeBootstrapCallInfo
static <T> BootstrapCallInfo<T> makeBootstrapCallInfo(MethodHandle bsm, String name, T type, ConstantGroup constants)
Make a new bootstrap call descriptor with the given components.- Type Parameters:
-
T
- the type of the invocation type, eitherMethodHandle
orClass
- Parameters:
-
bsm
- bootstrap method -
name
- invocation name -
type
- invocation type -
constants
- the additional static arguments for the bootstrap method - Returns:
- a new bootstrap call descriptor with the given components
-
-