Annotation Interface FieldGetterHandle
Assigns a java.lang.invoke.MethodHandle
to the annotated parameter which represents a getter of the represented field.
For a binding to be valid, the instrumented type must be able to access a field of the given name.
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 Advice.FieldGetterHandle
or
MemberSubstitution.FieldSetterHandle
. This annotation should be used with
MethodDelegation
only.
- See Also:
-
Nested Class Summary
Nested Classes -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionClass
<?> Defines the type on which the field is declared.The name of the field to be accessed.
-
Element Details
-
value
String valueThe name of the field to be accessed.- Returns:
- The name of the field.
- Default:
""
-
declaringType
Class<?> declaringTypeDefines the type on which the field is declared. If this value is not set, the most specific type's field is read, if two fields with the same name exist in the same type hierarchy.- Returns:
- The type that declares the accessed field.
- Default:
void.class
-