Class TargetMethodAnnotationDrivenBinder.DelegationProcessor
java.lang.Object
net.bytebuddy.implementation.bind.annotation.TargetMethodAnnotationDrivenBinder.DelegationProcessor
- Enclosing class:
- TargetMethodAnnotationDrivenBinder
@Enhance
protected static class TargetMethodAnnotationDrivenBinder.DelegationProcessor
extends Object
A delegation processor is a helper class for a
TargetMethodAnnotationDrivenBinder
for performing its actual logic. By outsourcing this logic to this helper class, a cleaner implementation
can be provided.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interface
A handler is responsible for processing a parameter's binding. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map<? extends TypeDescription,
? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> A map of registered annotation types to the binder that is responsible for binding a parameter that is annotated with the given annotation. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DelegationProcessor
(Map<? extends TypeDescription, ? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders) Creates a new delegation processor. -
Method Summary
Modifier and TypeMethodDescriptionprotected static TargetMethodAnnotationDrivenBinder.DelegationProcessor
of
(List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders) Creates a new delegation processor.prepare
(ParameterDescription target) Locates a handler which is responsible for processing the given parameter.
-
Field Details
-
parameterBinders
private final Map<? extends TypeDescription,? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBindersA map of registered annotation types to the binder that is responsible for binding a parameter that is annotated with the given annotation.
-
-
Constructor Details
-
DelegationProcessor
protected DelegationProcessor(Map<? extends TypeDescription, ? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders) Creates a new delegation processor.- Parameters:
parameterBinders
- A mapping of parameter binders by their handling type.
-
-
Method Details
-
of
protected static TargetMethodAnnotationDrivenBinder.DelegationProcessor of(List<? extends TargetMethodAnnotationDrivenBinder.ParameterBinder<?>> parameterBinders) Creates a new delegation processor.- Parameters:
parameterBinders
- A list of parameter binder delegates. Each such delegate is responsible for creating aMethodDelegationBinder.ParameterBinding
for a specific annotation.- Returns:
- A corresponding delegation processor.
-
prepare
protected TargetMethodAnnotationDrivenBinder.DelegationProcessor.Handler prepare(ParameterDescription target) Locates a handler which is responsible for processing the given parameter. If no explicit handler can be located, a fallback handler is provided.- Parameters:
target
- The target parameter being handled.- Returns:
- A handler for processing the parameter with the given annotations.
-