Annotation Type MemberSubstitution.SelfCallHandle

Enclosing class:
MemberSubstitution

@Documented @Retention(RUNTIME) @Target(PARAMETER) public static @interface MemberSubstitution.SelfCallHandle

Indicates that the annotated parameter should load a java.lang.invoke.MethodHandle that represents an invocation of the substituted expression or instrumented method. If the current method is virtual, it is bound to the current instance such that the virtual hierarchy is avoided. This annotation cannot be used to acquire a handle on enclosing constructors.

Important: Don't confuse this annotation with Advice.SelfCallHandle. This annotation should be used only in combination with MemberSubstitution.Substitution.Chain.Step.ForDelegation.

See Also:
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Determines if the method is bound to the arguments and instance of the represented invocation.
    Determines the source that is considered for this annotation which can be either the substituted method, constructor or field, or the instrumented method.
  • Element Details

    • source

      Determines the source that is considered for this annotation which can be either the substituted method, constructor or field, or the instrumented method.
      Returns:
      The source that is considered for this annotation.
      Default:
      SUBSTITUTED_ELEMENT
    • bound

      boolean bound
      Determines if the method is bound to the arguments and instance of the represented invocation.
      Returns:
      true if the handle should be bound to the current arguments.
      Default:
      true