@Documented @Retention(value=RUNTIME) @Target(value=PARAMETER) public static @interface Advice.FieldValue
Indicates that the annotated parameter should be mapped to a field in the scope of the instrumented method.
Important: Parameters with this option must not be used when from a constructor in combination with
Advice.OnMethodEnter and a non-static field where the
this reference is not available.
Note: As the mapping is virtual, Byte Buddy might be required to reserve more space on the operand stack than the
optimal value when accessing this parameter. This does not normally matter as the additional space requirement is minimal.
However, if the runtime performance of class creation is secondary, one can require ASM to recompute the optimal frames by
ClassWriter.COMPUTE_MAXS. This is however only relevant when writing to a non-static field.
|Modifier and Type||Required Element and Description|
Returns the name of the field.
|Modifier and Type||Optional Element and Description|
Returns the type that declares the field that should be mapped to the annotated parameter.
Indicates if it is possible to write to this parameter.
The typing that should be applied when assigning the field value.
public abstract String value
public abstract Class<?> declaringType
void, the field is looked up implicitly within the instrumented class's class hierarchy. The value can also be set to
TargetTypein order to look up the type on the instrumented type.
voidif this type should be determined implicitly or
TargetTypefor the instrumented type.
public abstract boolean readOnly
false, the annotated type must be equal to the mapped field type 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 field type.
trueif this parameter is read-only.
public abstract Assigner.Typing typing
Copyright © 2014–2017. All rights reserved.