@HashCodeAndEqualsPlugin.Enhance public static class FieldProxy.Binder extends TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<FieldProxy>
FieldProxy
annotation.Modifier and Type | Class and Description |
---|---|
protected class |
FieldProxy.Binder.AccessorProxy
A proxy type for accessing a field either by a getter or a setter.
|
protected static class |
FieldProxy.Binder.FieldGetter
Implementation for a getter method.
|
protected static interface |
FieldProxy.Binder.FieldResolver
A resolver for creating an instrumentation for a field access.
|
protected static class |
FieldProxy.Binder.FieldSetter
Implementation for a setter method.
|
protected static class |
FieldProxy.Binder.InstanceFieldConstructor
Represents an implementation for implementing a proxy type constructor when a non-static field is accessed.
|
protected static class |
FieldProxy.Binder.StaticFieldConstructor
Represents an implementation for implementing a proxy type constructor when a static field is accessed.
|
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends Annotation>
BEAN_PROPERTY
DEFAULTS
Modifier | Constructor and Description |
---|---|
protected |
Binder(FieldProxy.Binder.FieldResolver.Factory fieldResolverFactory)
Creates a new binder for a
FieldProxy . |
protected |
Binder(MethodDescription.InDefinedShape getterMethod,
MethodDescription.InDefinedShape setterMethod)
Creates a new binder for a
FieldProxy in simplex mode. |
protected |
Binder(TypeDescription proxyType,
MethodDescription.InDefinedShape getterMethod,
MethodDescription.InDefinedShape setterMethod)
Creates a new binder for a
FieldProxy in duplex mode. |
Modifier and Type | Method and Description |
---|---|
protected MethodDelegationBinder.ParameterBinding<?> |
bind(FieldDescription fieldDescription,
AnnotationDescription.Loadable<FieldProxy> annotation,
MethodDescription source,
ParameterDescription target,
Implementation.Target implementationTarget,
Assigner assigner)
Creates a parameter binding for the given target parameter.
|
protected TypeDescription |
declaringType(AnnotationDescription.Loadable<FieldProxy> annotation)
Extracts the declaring type from an annotation.
|
protected String |
fieldName(AnnotationDescription.Loadable<FieldProxy> annotation)
Extracts the field name from an annotation.
|
Class<FieldProxy> |
getHandledType()
The annotation type that is handled by this parameter binder.
|
static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> |
install(Class<?> type)
Creates a binder by installing a single proxy type where annotating a parameter with
FieldProxy allows
getting and setting values for a given field. |
static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> |
install(Class<?> getterType,
Class<?> setterType)
Creates a binder by installing two proxy types which are implemented by this binder if a field getter
or a field setter is requested by using the
FieldProxy annotation. |
static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> |
install(TypeDescription typeDescription)
Creates a binder by installing a single proxy type where annotating a parameter with
FieldProxy allows
getting and setting values for a given field. |
static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> |
install(TypeDescription getterType,
TypeDescription setterType)
Creates a binder by installing two proxy types which are implemented by this binder if a field getter
or a field setter is requested by using the
FieldProxy annotation. |
bind
protected Binder(MethodDescription.InDefinedShape getterMethod, MethodDescription.InDefinedShape setterMethod)
FieldProxy
in simplex mode.getterMethod
- The getter method.setterMethod
- The setter method.protected Binder(TypeDescription proxyType, MethodDescription.InDefinedShape getterMethod, MethodDescription.InDefinedShape setterMethod)
FieldProxy
in duplex mode.proxyType
- The proxy type.getterMethod
- The getter method.setterMethod
- The setter method.protected Binder(FieldProxy.Binder.FieldResolver.Factory fieldResolverFactory)
FieldProxy
.fieldResolverFactory
- The field resolver factory to apply by this binder.public static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> install(Class<?> type)
FieldProxy
allows
getting and setting values for a given field.type
- A type which declares exactly one abstract getter and an abstract setter for the Object
type. The type is allowed to be generic.FieldProxy
annotation.public static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> install(TypeDescription typeDescription)
FieldProxy
allows
getting and setting values for a given field.typeDescription
- A type which declares exactly one abstract getter and an abstract setter for the Object
type. The type is allowed to be generic.FieldProxy
annotation.public static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> install(Class<?> getterType, Class<?> setterType)
FieldProxy
annotation.getterType
- The type which should be used for getter proxies. The type must
represent an interface which defines a single method which returns an
Object
return type and does not take any arguments. The use of generics
is permitted.setterType
- The type which should be uses for setter proxies. The type must
represent an interface which defines a single method which returns void
and takes a single Object
-typed argument. The use of generics
is permitted.FieldProxy
annotation.public static TargetMethodAnnotationDrivenBinder.ParameterBinder<FieldProxy> install(TypeDescription getterType, TypeDescription setterType)
FieldProxy
annotation.getterType
- The type which should be used for getter proxies. The type must
represent an interface which defines a single method which returns an
Object
return type and does not take any arguments. The use of generics
is permitted.setterType
- The type which should be uses for setter proxies. The type must
represent an interface which defines a single method which returns void
and takes a single Object
-typed argument. The use of generics
is permitted.FieldProxy
annotation.public Class<FieldProxy> getHandledType()
Annotation.annotationType()
handled by this parameter binder.protected String fieldName(AnnotationDescription.Loadable<FieldProxy> annotation)
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding
fieldName
in class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<FieldProxy>
annotation
- The annotation from which to extract the field name.protected TypeDescription declaringType(AnnotationDescription.Loadable<FieldProxy> annotation)
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding
declaringType
in class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<FieldProxy>
annotation
- The annotation from which to extract the declaring type.protected MethodDelegationBinder.ParameterBinding<?> bind(FieldDescription fieldDescription, AnnotationDescription.Loadable<FieldProxy> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner)
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding
bind
in class TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<FieldProxy>
fieldDescription
- The field for which this binder binds a value.annotation
- The annotation that was cause for the delegation to this argument binder.source
- The intercepted source method.target
- Tge target parameter that is subject to be bound to
intercepting the source
method.implementationTarget
- The target of the current implementation that is subject to this binding.assigner
- An assigner that can be used for applying the binding.Copyright © 2014–2020. All rights reserved.