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 FieldGetterHandle#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 Note
Don't confuse this annotation with net. or
net.. This annotation should be used with
net. only.
net.bytebuddy.implementation.MethodDelegation , TargetMethodAnnotationDrivenBinder, RuntimeType
| Modifier and Type | Class and Description |
|---|---|
| public static enum | FieldGetterHandle.Binder
Binds a |
| Modifier and Type | Method and Description |
|---|---|
| public Class | Returns: The type that declares the accessed field.Defines the type on which the field is declared. |
| public String |
| declaringType | back to summary |
|---|---|
| public Class Defines 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.
| |
| value | back to summary |
|---|---|
| public String value() The name of the field to be accessed.
| |
FieldGetterHandle annotation.
| Modifier and Type | Class and Description |
|---|---|
| protected static class | FieldGetterHandle.Binder.Delegate
A delegate implementation for the |
| Modifier and Type | Field and Description |
|---|---|
| private static final MethodDescription. | DECLARING_TYPE
The annotation method that for the defining type. |
| private final TargetMethodAnnotationDrivenBinder. | delegate
A delegate parameter binder responsible for binding the parameter. |
| private static final MethodDescription. | FIELD_NAME
The annotation method for the field's name. |
| public static final FieldGetterHandle. | INSTANCE
The singleton instance. |
| Access | Constructor and Description |
|---|---|
| private | Binder(TargetMethodAnnotationDrivenBinder.
A delegate parameter binder responsible for binding the parameter. delegateCreates a new binder for a |
| Modifier and Type | Method and Description |
|---|---|
| public MethodDelegationBinder. | bind(AnnotationDescription.
The annotation that was cause for the delegation to this argument binder. annotation,The intercepted source method. source, ParameterDescription Tge target parameter that is subject to be bound to
intercepting the target, Implementation.source method.The target of the current implementation that is subject to this binding. implementationTarget,An assigner that can be used for applying the binding. assigner, Assigner.The typing to apply. typingImplements net. |
| public Class | getHandledType()
The annotation type that is handled by this parameter binder.
|
| public static FieldGetterHandle. | |
| public static FieldGetterHandle. |
| DECLARING_TYPE | back to summary |
|---|---|
| private static final MethodDescription. The annotation method that for the defining type. | |
| delegate | back to summary |
|---|---|
| private final TargetMethodAnnotationDrivenBinder. A delegate parameter binder responsible for binding the parameter. | |
| FIELD_NAME | back to summary |
|---|---|
| private static final MethodDescription. The annotation method for the field's name. | |
| INSTANCE | back to summary |
|---|---|
| public static final FieldGetterHandle. The singleton instance. | |
| Binder | back to summary |
|---|---|
| private Binder(TargetMethodAnnotationDrivenBinder. Creates a new binder for a
| |
| bind | back to summary |
|---|---|
| public MethodDelegationBinder. Implements net. Doc from net. Creates a parameter binding for the given target parameter.
| |
| getHandledType | back to summary |
|---|---|
| public Class The annotation type that is handled by this parameter binder.
| |
| valueOf | back to summary |
|---|---|
| public static FieldGetterHandle. | |
| values | back to summary |
|---|---|
| public static FieldGetterHandle. | |
FieldGetterHandle.Binder .
| Access | Constructor and Description |
|---|---|
| protected |
| Modifier and Type | Method and Description |
|---|---|
| protected MethodDelegationBinder. | bind(FieldDescription
The field for which this binder binds a value. fieldDescription, AnnotationDescription.The annotation that was cause for the delegation to this argument binder. annotation,The intercepted source method. source, ParameterDescription Tge target parameter that is subject to be bound to
intercepting the target, Implementation.source method.The target of the current implementation that is subject to this binding. implementationTarget,An assigner that can be used for applying the binding. assigner)Implements abstract net. |
| protected TypeDescription | declaringType(AnnotationDescription.
The annotation from which to extract the declaring type. annotationImplements abstract net. |
| protected String | fieldName(AnnotationDescription.
The annotation from which to extract the field name. annotationImplements abstract net. |
| public Class | getHandledType()
The annotation type that is handled by this parameter binder.
|
| Delegate | back to summary |
|---|---|
| protected Delegate() | |
| bind | back to summary |
|---|---|
| protected MethodDelegationBinder. Implements abstract net. Creates a parameter binding for the given target parameter.
| |
| declaringType | back to summary |
|---|---|
| protected TypeDescription declaringType(AnnotationDescription. Implements abstract net. Extracts the declaring type from an annotation.
| |
| fieldName | back to summary |
|---|---|
| protected String fieldName(AnnotationDescription. Implements abstract net. Extracts the field name from an annotation.
| |
| getHandledType | back to summary |
|---|---|
| public Class The annotation type that is handled by this parameter binder.
| |