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 interfaceA default method locator is responsible for looking up a default method to a given source method.protected static classA proxy that implements the installed interface in order to allow for a morphed super method invocation.Nested classes/interfaces inherited from interface TargetMethodAnnotationDrivenBinder.ParameterBinder
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final MethodDescription.InDefinedShapeA reference to the default method method.private static final MethodDescription.InDefinedShapeA reference to the default target method.private final MethodDescriptionThe method which is overridden for generating the proxy class.private static final MethodDescription.InDefinedShapeA reference to the serializable proxy method.Fields inherited from interface TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBinder(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 aMorphannotation.install(TypeDescription typeDescription) Installs a given type for use on aMorphannotation.private static MethodDescriptiononlyMethod(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 aMorphannotation. The given type must be an interface without any super interfaces and a single method which maps anObjectarray to aObjecttype. The use of generics is permitted.- Parameters:
type- The type to install.- Returns:
- A binder for the
Morphannotation.
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Morph> install(TypeDescription typeDescription) Installs a given type for use on aMorphannotation. The given type must be an interface without any super interfaces and a single method which maps anObjectarray to aObjecttype. The use of generics is permitted.- Parameters:
typeDescription- The type to install.- Returns:
- A binder for the
Morphannotation.
-
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:
getHandledTypein 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:
bindin 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 thesourcemethod.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.
-