Annotation Type Advice.Return
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public static @interface Advice.ReturnIndicates 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.
0for numeric types andnullfor reference types. If the return type isvoid, the annotated value isnullif and only iftyping()is set toAssigner.Typing.DYNAMIC.Note: This annotation must only be used on
Advice.OnMethodExitadvice methods.- See Also:
Advice,Advice.OnMethodExit
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description booleanreadOnlyIndicates if it is possible to write to this parameter.Assigner.TypingtypingDetermines the typing that is applied when assigning the return value.
-
-
-
Element Detail
-
readOnly
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 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
trueif the advice method is not inlined.- Returns:
trueif this parameter is read-only.
- Default:
- true
-
-
-
typing
Assigner.Typing typing
Determines the typing that is applied when assigning the return value.- Returns:
- The typing to apply when assigning the annotated parameter.
- Default:
- net.bytebuddy.implementation.bytecode.assign.Assigner.Typing.STATIC
-
-