Package net.bytebuddy.asm
Annotation Type MemberSubstitution.FieldValue
-
@Documented @Retention(RUNTIME) @Target({PARAMETER,METHOD,CONSTRUCTOR}) public static @interface MemberSubstitution.FieldValue
Indicates that the annotated parameter should be mapped to a field in the scope of the instrumented type.
Setting
value()
is optional. If the value is not set, the field value attempts to bind a setter's or getter's field if the intercepted method is an accessor method. Otherwise, the binding renders the target method to be an illegal candidate for binding.Important: Don't confuse this annotation with
FieldValue
orAdvice.FieldValue
. This annotation should be used only in combination withMemberSubstitution.Substitution.Chain.Step.ForDelegation
.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<?>
declaringType
Returns the type that declares the field that should be mapped to the annotated parameter.Assigner.Typing
typing
The typing that should be applied when assigning the field value.java.lang.String
value
Returns the name of the field.
-
-
-
-
declaringType
java.lang.Class<?> declaringType
Returns the type that declares the field that should be mapped to the annotated parameter. If this property is set tovoid
, the field is looked up implicitly within the instrumented class's class hierarchy. The value can also be set toTargetType
in order to look up the type on the instrumented type.- Returns:
- The type that declares the field,
void
if this type should be determined implicitly orTargetType
for the instrumented type.
- Default:
- void.class
-
-
-
typing
Assigner.Typing typing
The typing that should be applied when assigning the field value.- Returns:
- The typing to apply upon assignment.
- Default:
- net.bytebuddy.implementation.bytecode.assign.Assigner.Typing.STATIC
-
-