Annotation Interface Advice.This
- Enclosing class:
Advice
Indicates that the annotated parameter should be mapped to the this
reference of the instrumented method.
Important: Parameters with this option must not be used when from a constructor in combination with
Advice.OnMethodEnter
where the this
reference is not available.
Important: Don't confuse this annotation with This
or
MemberSubstitution.This
. This annotation should be used only in combination with Advice
.
- See Also:
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Determines if the parameter should be assignednull
if the instrumented method is static or a constructor within an enter advice.boolean
Indicates if it is possible to write to this parameter.The typing that should be applied when assigning thethis
value.
-
Element Details
-
readOnly
boolean readOnlyIndicates if it is possible to write to this parameter. If this property is set to
false
, the annotated type must be equal to the type declaring the instrumented method if the typing is not also set toAssigner.Typing.DYNAMIC
. If this property is set totrue
, the annotated parameter can be any super type of the instrumented method's declaring type.Important: This property must be set to
true
if the advice method is not inlined.- Returns:
true
if this parameter is read-only.
- Default:
true
-
typing
Assigner.Typing typingThe typing that should be applied when assigning thethis
value.- Returns:
- The typing to apply upon assignment.
- Default:
STATIC
-
optional
boolean optionalDetermines if the parameter should be assignednull
if the instrumented method is static or a constructor within an enter advice.- Returns:
true
if the value assignment is optional.
- Default:
false
-