Class Morph.Binder
java.lang.Object
net.bytebuddy.implementation.bind.annotation.Morph.Binder
- All Implemented Interfaces:
TargetMethodAnnotationDrivenBinder.ParameterBinder<Morph>
- Enclosing class:
- Morph
@Enhance
public static class Morph.Binder
extends Object
implements TargetMethodAnnotationDrivenBinder.ParameterBinder<Morph>
A binder for the
Morph
annotation.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A default method locator is responsible for looking up a default method to a given source method.protected static class
A proxy that implements the installed interface in order to allow for a morphed super method invocation.Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends Annotation>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final MethodDescription.InDefinedShape
A reference to the default method method.private static final MethodDescription.InDefinedShape
A reference to the default target method.private final MethodDescription
The method which is overridden for generating the proxy class.private static final MethodDescription.InDefinedShape
A reference to the serializable proxy method.Fields inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
Binder
(MethodDescription forwardingMethod) Creates a new binder. -
Method Summary
Modifier and TypeMethodDescriptionbind
(AnnotationDescription.Loadable<Morph> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing) Creates a parameter binding for the given target parameter.The annotation type that is handled by this parameter binder.Installs a given type for use on aMorph
annotation.install
(TypeDescription typeDescription) Installs a given type for use on aMorph
annotation.private static MethodDescription
onlyMethod
(TypeDescription typeDescription) Extracts the only method of a given type and validates to fit the constraints of the morph annotation.
-
Field Details
-
SERIALIZABLE_PROXY
A reference to the serializable proxy method. -
DEFAULT_METHOD
A reference to the default method method. -
DEFAULT_TARGET
A reference to the default target method. -
forwardingMethod
The method which is overridden for generating the proxy class.
-
-
Constructor Details
-
Binder
Creates a new binder.- Parameters:
forwardingMethod
- The method which is overridden for generating the proxy class.
-
-
Method Details
-
install
Installs a given type for use on aMorph
annotation. The given type must be an interface without any super interfaces and a single method which maps anObject
array to aObject
type. The use of generics is permitted.- Parameters:
type
- The type to install.- Returns:
- A binder for the
Morph
annotation.
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Morph> install(TypeDescription typeDescription) Installs a given type for use on aMorph
annotation. The given type must be an interface without any super interfaces and a single method which maps anObject
array to aObject
type. The use of generics is permitted.- Parameters:
typeDescription
- The type to install.- Returns:
- A binder for the
Morph
annotation.
-
onlyMethod
Extracts the only method of a given type and validates to fit the constraints of the morph annotation.- Parameters:
typeDescription
- The type to extract the method from.- Returns:
- The only method after validation.
-
getHandledType
The annotation type that is handled by this parameter binder.- Specified by:
getHandledType
in interfaceTargetMethodAnnotationDrivenBinder.ParameterBinder<Morph>
- Returns:
- The
Annotation.annotationType()
handled by this parameter binder.
-
bind
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<Morph> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing) Creates a parameter binding for the given target parameter.- Specified by:
bind
in interfaceTargetMethodAnnotationDrivenBinder.ParameterBinder<Morph>
- Parameters:
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 thesource
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.typing
- The typing to apply.- Returns:
- A parameter binding for the requested target method parameter.
-