@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Advice.This
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.
Advice
,
Advice.OnMethodEnter
,
Advice.OnMethodExit
Modifier and Type | Optional Element and Description |
---|---|
boolean |
optional
Determines if the parameter should be assigned
null if the instrumented method is static or a constructor within an enter advice. |
boolean |
readOnly
Indicates if it is possible to write to this parameter.
|
Assigner.Typing |
typing
The typing that should be applied when assigning the
this value. |
public abstract boolean optional
null
if the instrumented method is static or a constructor within an enter advice.true
if the value assignment is optional.public abstract boolean readOnly
Indicates 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 to Assigner.Typing#DYNAMIC
.
If this property is set to true
, 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.
true
if this parameter is read-only.public abstract Assigner.Typing typing
this
value.Copyright © 2014–2019. All rights reserved.