Package io.micronaut.http.bind
Class DefaultRequestBinderRegistry
java.lang.Object
io.micronaut.http.bind.DefaultRequestBinderRegistry
- All Implemented Interfaces:
ArgumentBinderRegistry<HttpRequest<?>>
,RequestBinderRegistry
@Singleton
public class DefaultRequestBinderRegistry
extends Object
implements RequestBinderRegistry
Default implementation of the
RequestBinderRegistry
interface.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Constructor Summary
ConstructorDescriptionDefaultRequestBinderRegistry
(ConversionService conversionService, RequestArgumentBinder... binders) DefaultRequestBinderRegistry
(ConversionService conversionService, List<RequestArgumentBinder> binders) DefaultRequestBinderRegistry
(ConversionService conversionService, List<RequestArgumentBinder> binders, DefaultBodyAnnotationBinder bodyAnnotationBinder) -
Method Summary
Modifier and TypeMethodDescription<T> void
addArgumentBinder
(ArgumentBinder<T, HttpRequest<?>> binder) Adds a request argument binder to the registry.void
Adds a request argument binder that will be used to match the argument that wasn't matched by a type or an annotation.<T> Optional<ArgumentBinder<T,
HttpRequest<?>>> findArgumentBinder
(Argument<T> argument) Locate anArgumentBinder
for the given argument.protected <T> RequestArgumentBinder
findBinder
(Argument<T> argument, Class<? extends Annotation> annotationType) protected void
registerDefaultAnnotationBinders
(Map<Class<? extends Annotation>, RequestArgumentBinder> byAnnotation) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.core.bind.ArgumentBinderRegistry
addRequestArgumentBinder, findArgumentBinder
-
Constructor Details
-
DefaultRequestBinderRegistry
public DefaultRequestBinderRegistry(ConversionService conversionService, RequestArgumentBinder... binders) - Parameters:
conversionService
- The conversion servicebinders
- The request argument binders
-
DefaultRequestBinderRegistry
public DefaultRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders) -
DefaultRequestBinderRegistry
@Inject public DefaultRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders, DefaultBodyAnnotationBinder bodyAnnotationBinder) - Parameters:
conversionService
- The conversion servicebinders
- The request argument bindersbodyAnnotationBinder
- The body annotation binder
-
-
Method Details
-
addArgumentBinder
Description copied from interface:ArgumentBinderRegistry
Adds a request argument binder to the registry.- Specified by:
addArgumentBinder
in interfaceArgumentBinderRegistry<HttpRequest<?>>
- Type Parameters:
T
- The argument type- Parameters:
binder
- The binder
-
addUnmatchedRequestArgumentBinder
Description copied from interface:RequestBinderRegistry
Adds a request argument binder that will be used to match the argument that wasn't matched by a type or an annotation.- Specified by:
addUnmatchedRequestArgumentBinder
in interfaceRequestBinderRegistry
- Parameters:
binder
- The binder
-
findArgumentBinder
Description copied from interface:ArgumentBinderRegistry
Locate anArgumentBinder
for the given argument.- Specified by:
findArgumentBinder
in interfaceArgumentBinderRegistry<HttpRequest<?>>
- Type Parameters:
T
- The argument type- Parameters:
argument
- The argument- Returns:
- An
Optional
ofArgumentBinder
-
findBinder
protected <T> RequestArgumentBinder findBinder(Argument<T> argument, Class<? extends Annotation> annotationType) - Type Parameters:
T
- The type- Parameters:
argument
- The argumentannotationType
- The class for annotation- Returns:
- The request argument binder
-
registerDefaultAnnotationBinders
protected void registerDefaultAnnotationBinders(Map<Class<? extends Annotation>, RequestArgumentBinder> byAnnotation) - Parameters:
byAnnotation
- The request argument binder
-