Annotation Type Advice.FieldGetterHandle
-
@Documented @Retention(RUNTIME) @Target(PARAMETER) public static @interface Advice.FieldGetterHandleIndicates that the annotated parameter should be mapped to a
java.lang.invoke.MethodHandlerepresenting a field getter.Setting
Advice.FieldValue.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: Parameters with this option must not be used when from a constructor in combination with
Advice.OnMethodEnterand a non-static field where thethisreference is not available.Important: Don't confuse this annotation with
FieldGetterHandleorMemberSubstitution.FieldGetterHandle. This annotation should be used only in combination withAdvice.- See Also:
Advice,Advice.OnMethodEnter,Advice.OnMethodExit
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description java.lang.Class<?>declaringTypeReturns the type that declares the field that should be mapped to the annotated parameter.java.lang.StringvalueReturns 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 toTargetTypein order to look up the type on the instrumented type.- Returns:
- The type that declares the field,
voidif this type should be determined implicitly orTargetTypefor the instrumented type.
- Default:
- void.class
-
-