Annotation Interface AllArguments
Parameters that are annotated with this annotation will be assigned an array of all arguments of the instrumented method.
By default, this annotation applies a
AllArguments.Assignment.STRICT
assignment of the source method's parameters to the array. This implies that parameters that are not assignable to
the annotated array's component type make the method with this parameter unbindable. To avoid this, you can
use a AllArguments.Assignment.SLACK
assignment
which simply skips non-assignable values instead.
Important: Don't confuse this annotation with Advice.AllArguments
annotation. This annotation
should be used only in combination with method delegation
(MethodDelegation.to(...)
).
For Advice
ASM visitor use alternative annotation from
net.bytebuddy.asm.Advice
package.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
A directive for how anAllArguments
annotation on an array is to be interpreted.static enum
A binder for handling theAllArguments
annotation. -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionboolean
Determines if the array should contain the instance that defines the intercepted value when intercepting a non-static method.boolean
Determines if anull
value should be assigned if the instrumented method does not declare any parameters.Defines the type ofAllArguments.Assignment
type that is applied for filling the annotated array with values.
-
Element Details
-
value
AllArguments.Assignment valueDefines the type ofAllArguments.Assignment
type that is applied for filling the annotated array with values.- Returns:
- The assignment handling to be applied for the annotated parameter.
- Default:
- STRICT
-
includeSelf
boolean includeSelfDetermines if the array should contain the instance that defines the intercepted value when intercepting a non-static method.- Returns:
true
if the instance on which the intercepted method should be invoked should be included in the array containing the arguments.
- Default:
- false
-
nullIfEmpty
boolean nullIfEmptyDetermines if anull
value should be assigned if the instrumented method does not declare any parameters.- Returns:
true
if anull
value should be assigned if the instrumented method does not declare any parameters.
- Default:
- false
-