@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Advice.AllArguments
Assigns an array containing all arguments of the instrumented method to the annotated parameter. The annotated parameter must
be an array type. If the annotation indicates writability, the assigned array must have at least as many values as the
instrumented method or an ArrayIndexOutOfBoundsException
is thrown.
Important: Don't confuse this annotation with AllArguments
or
MemberSubstitution.AllArguments
. This annotation should be used only in combination with Advice
.
Advice
,
Advice.OnMethodEnter
,
Advice.OnMethodExit
Modifier and Type | Optional Element and Description |
---|---|
boolean |
includeSelf
Determines if the produced array should include the instrumented method's target reference within the array, if
the instrumented method is non-static.
|
boolean |
nullIfEmpty
Determines if a
null value should be assigned if the instrumented method does not declare any parameters. |
boolean |
readOnly
Indicates if it is possible to write to this parameter.
|
Assigner.Typing |
typing
The typing that should be applied when assigning the arguments.
|
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
public abstract boolean includeSelf
true
if the method's target instance should be considered an element of the produced array.public abstract boolean nullIfEmpty
null
value should be assigned if the instrumented method does not declare any parameters.
If this option is set and a value is written to annotated parameter, the operation remains without effect.true
if a null
value should be assigned if the instrumented method does not declare any parameters.Copyright © 2014–2023. All rights reserved.