Class Pipe.Binder
- java.lang.Object
-
- net.bytebuddy.implementation.bind.annotation.Pipe.Binder
-
- All Implemented Interfaces:
TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>
- Enclosing class:
- Pipe
@Enhance public static class Pipe.Binder extends java.lang.Object implements TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>
ATargetMethodAnnotationDrivenBinder.ParameterBinderfor binding thePipeannotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classPipe.Binder.RedirectionProxyAn auxiliary type for performing the redirection of a method invocation as requested by thePipeannotation.-
Nested classes/interfaces inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFieldBinding<S extends java.lang.annotation.Annotation>, TargetMethodAnnotationDrivenBinder.ParameterBinder.ForFixedValue<S extends java.lang.annotation.Annotation>
-
-
Field Summary
Fields Modifier and Type Field Description private MethodDescriptionforwardingMethodThe method which implements the behavior of forwarding a method invocation.private static MethodDescription.InDefinedShapeSERIALIZABLE_PROXYA description of thePipe.serializableProxy()method.-
Fields inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedBinder(MethodDescription forwardingMethod)Creates a new binder.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description MethodDelegationBinder.ParameterBinding<?>bind(AnnotationDescription.Loadable<Pipe> annotation, MethodDescription source, ParameterDescription target, Implementation.Target implementationTarget, Assigner assigner, Assigner.Typing typing)Creates a parameter binding for the given target parameter.java.lang.Class<Pipe>getHandledType()The annotation type that is handled by this parameter binder.static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>install(java.lang.Class<?> type)Installs a given type for use on aPipeannotation.static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>install(TypeDescription typeDescription)Installs a given type for use on aPipeannotation.private static MethodDescriptiononlyMethod(TypeDescription typeDescription)Locates the only method of a type that is compatible to being overridden for invoking the proxy.
-
-
-
Field Detail
-
SERIALIZABLE_PROXY
private static final MethodDescription.InDefinedShape SERIALIZABLE_PROXY
A description of thePipe.serializableProxy()method.
-
forwardingMethod
private final MethodDescription forwardingMethod
The method which implements the behavior of forwarding a method invocation. This method needs to define a single non-static method with anObjecttoObjectmapping.
-
-
Constructor Detail
-
Binder
protected Binder(MethodDescription forwardingMethod)
Creates a new binder. This constructor is not doing any validation of the forwarding method and its declaring type. Such validation is normally performed by theinstall(Class)method.- Parameters:
forwardingMethod- The method which implements the behavior of forwarding a method invocation. This method needs to define a single non-static method with anObjecttoObjectmapping.
-
-
Method Detail
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe> install(java.lang.Class<?> type)
Installs a given type for use on aPipeannotation. The given type must be an interface without any super interfaces and a single method which maps anObjecttype to anotherObjecttype. The use of generics is permitted.- Parameters:
type- The type to install.- Returns:
- A binder for the
Pipeannotation.
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe> install(TypeDescription typeDescription)
Installs a given type for use on aPipeannotation. The given type must be an interface without any super interfaces and a single method which maps anObjecttype to anotherObjecttype. The use of generics is permitted.- Parameters:
typeDescription- The type to install.- Returns:
- A binder for the
Pipeannotation.
-
onlyMethod
private static MethodDescription onlyMethod(TypeDescription typeDescription)
Locates the only method of a type that is compatible to being overridden for invoking the proxy.- Parameters:
typeDescription- The type that is being installed.- Returns:
- Its only method after validation.
-
getHandledType
public java.lang.Class<Pipe> getHandledType()
The annotation type that is handled by this parameter binder.- Specified by:
getHandledTypein interfaceTargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>- Returns:
- The
Annotation.annotationType()handled by this parameter binder.
-
bind
public MethodDelegationBinder.ParameterBinding<?> bind(AnnotationDescription.Loadable<Pipe> 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<Pipe>- 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.
-
-