@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public @interface DynamicConstant
Binds a dynamic constant to the annotated parameter. The constant is either bound by using constantdynamic or invokedynamic.
 Important: Don't confuse this annotation with Advice.DynamicConstant or
 MemberSubstitution.DynamicConstant. This annotation should be used with
 MethodDelegation only.
 
| Modifier and Type | Required Element and Description | 
|---|---|
| String | bootstrapNameReturns the name of the bootstrap method handle. | 
| Class<?>[] | bootstrapParameterTypesReturns the parameter types of the bootstrap method handle. | 
| Class<?> | bootstrapReturnTypeReturns the return type of the bootstrap method handle. | 
| JavaConstant.MethodHandle.HandleType | bootstrapTypeReturns the type of the bootstrap method handle to resolve. | 
| Modifier and Type | Optional Element and Description | 
|---|---|
| Class<?> | bootstrapOwnerReturns the owner type of the bootstrap method handle, or  void, to represent the instrumented type. | 
| boolean | invokedynamicReturns  trueif invokedynamic should be used to bind the annotated parameter. | 
| String | nameReturns the name of the dynamic constant that is supplied to the bootstrap method. | 
public abstract JavaConstant.MethodHandle.HandleType bootstrapType
public abstract String bootstrapName
public abstract Class<?> bootstrapReturnType
public abstract Class<?>[] bootstrapParameterTypes
public abstract String name
public abstract Class<?> bootstrapOwner
void, to represent the instrumented type.void, to represent the instrumented type.Copyright © 2014–2025. All rights reserved.