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.ParameterBinder
for binding thePipe
annotation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
Pipe.Binder.Redirection
An auxiliary type for performing the redirection of a method invocation as requested by thePipe
annotation.-
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 MethodDescription
forwardingMethod
The method which implements the behavior of forwarding a method invocation.-
Fields inherited from interface net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.ParameterBinder
DEFAULTS
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Binder(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 aPipe
annotation.static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe>
install(TypeDescription typeDescription)
Installs a given type for use on aPipe
annotation.private static MethodDescription
onlyMethod(TypeDescription typeDescription)
Locates the only method of a type that is compatible to being overridden for invoking the proxy.
-
-
-
Field Detail
-
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 anObject
toObject
mapping.
-
-
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 anObject
toObject
mapping.
-
-
Method Detail
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe> install(java.lang.Class<?> type)
Installs a given type for use on aPipe
annotation. The given type must be an interface without any super interfaces and a single method which maps anObject
type to anotherObject
type. The use of generics is permitted.- Parameters:
type
- The type to install.- Returns:
- A binder for the
Pipe
annotation.
-
install
public static TargetMethodAnnotationDrivenBinder.ParameterBinder<Pipe> install(TypeDescription typeDescription)
Installs a given type for use on aPipe
annotation. The given type must be an interface without any super interfaces and a single method which maps anObject
type to anotherObject
type. The use of generics is permitted.- Parameters:
typeDescription
- The type to install.- Returns:
- A binder for the
Pipe
annotation.
-
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:
getHandledType
in 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:
bind
in 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 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.
-
-