Annotation Type DynamicConstant


@Documented @Retention(RUNTIME) @Target(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.

See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    A binder for handling the DynamicConstant annotation.
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    Returns the name of the bootstrap method handle.
    Class<?>[]
    Returns the parameter types of the bootstrap method handle.
    Returns the return type of the bootstrap method handle.
    Returns the type of the bootstrap method handle to resolve.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the owner type of the bootstrap method handle, or void, to represent the instrumented type.
    boolean
    Returns true if invokedynamic should be used to bind the annotated parameter.
    Returns the name of the dynamic constant that is supplied to the bootstrap method.
  • Element Details

    • name

      String name
      Returns the name of the dynamic constant that is supplied to the bootstrap method.
      Returns:
      The name of the dynamic constant that is supplied to the bootstrap method.
      Default:
      "_"
    • bootstrapType

      Returns the type of the bootstrap method handle to resolve.
      Returns:
      The type of the bootstrap method handle to resolve.
    • bootstrapOwner

      Class<?> bootstrapOwner
      Returns the owner type of the bootstrap method handle, or void, to represent the instrumented type.
      Returns:
      The owner type of the bootstrap method handle, or void, to represent the instrumented type.
      Default:
      void.class
    • bootstrapName

      String bootstrapName
      Returns the name of the bootstrap method handle.
      Returns:
      The name of the bootstrap method handle.
    • bootstrapReturnType

      Class<?> bootstrapReturnType
      Returns the return type of the bootstrap method handle.
      Returns:
      The return type of the bootstrap method handle.
    • bootstrapParameterTypes

      Class<?>[] bootstrapParameterTypes
      Returns the parameter types of the bootstrap method handle.
      Returns:
      The parameter types of the bootstrap method handle.
    • invokedynamic

      boolean invokedynamic
      Returns true if invokedynamic should be used to bind the annotated parameter.
      Returns:
      true if invokedynamic should be used to bind the annotated parameter.
      Default:
      false