Annotation Type Advice.Thrown
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public static @interface Advice.ThrownIndicates that the annotated parameter should be mapped to the
Throwablethrown by the instrumented method or tonullif the method returned regularly. Note that the Java runtime does not enforce checked exceptions. In order to capture any error, the parameter type must therefore be of typeThrowable. By assigning another value ornullto this parameter, a thrown exception can be suppressed.Note: This annotation must only be used on exit advice 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 capturedThrowableto the annotated parameter.
-
-
-
Element Detail
-
readOnly
boolean readOnly
Indicates if it is possible to write to this parameter. If this property is set to
false, it is illegal to write to the annotated parameter. If this property is set totrue, the annotated parameter can either be set tonullto suppress an exception that was thrown by the adviced method or it can be set to any other exception that will be thrown after the advice method returned.If an exception is suppressed, the default value for the return type is returned from the method, i.e.
0for any numeric type andnullfor a reference type. The default value can be replaced via theAdvice.Returnannotation.- Returns:
trueif this parameter is read-only.
- Default:
- true
-
-
-
typing
Assigner.Typing typing
Determines the typing that is applied when assigning the capturedThrowableto the annotated parameter.- Returns:
- The typing to apply when assigning the annotated parameter.
- Default:
- net.bytebuddy.implementation.bytecode.assign.Assigner.Typing.DYNAMIC
-
-