@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Advice.Return
Indicates that the annotated parameter should be mapped to the return value of the instrumented method. If the instrumented
method terminates exceptionally, the type's default value is assigned to the parameter, i.e. 0
for numeric types
and null
for reference types. If the return type is void
, the annotated value is null
if and only if
typing()
is set to Assigner.Typing#DYNAMIC
.
Note: This annotation must only be used on exit advice methods.
Advice
,
Advice.OnMethodExit
Modifier and Type | Optional Element and Description |
---|---|
boolean |
readOnly
Indicates if it is possible to write to this parameter.
|
Assigner.Typing |
typing
Determines the typing that is applied when assigning the return value.
|
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
Copyright © 2014–2019. All rights reserved.