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
ConstructorsConstructorDescriptionDefaultRequestBinderRegistry(ConversionService conversionService, RequestArgumentBinder... binders) DefaultRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders) DefaultRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders, DefaultBodyAnnotationBinder bodyAnnotationBinder) -
Method Summary
Modifier and TypeMethodDescription<T> voidaddArgumentBinder(ArgumentBinder<T, HttpRequest<?>> binder) Adds a request argument binder to the registry.voidAdds 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 anArgumentBinderfor the given argument.protected <T> RequestArgumentBinderfindBinder(Argument<T> argument, Class<? extends Annotation> annotationType) protected voidregisterDefaultAnnotationBinders(Map<Class<? extends Annotation>, RequestArgumentBinder> byAnnotation) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:ArgumentBinderRegistryAdds a request argument binder to the registry.- Specified by:
addArgumentBinderin interfaceArgumentBinderRegistry<HttpRequest<?>>- Type Parameters:
T- The argument type- Parameters:
binder- The binder
-
addUnmatchedRequestArgumentBinder
Description copied from interface:RequestBinderRegistryAdds a request argument binder that will be used to match the argument that wasn't matched by a type or an annotation.- Specified by:
addUnmatchedRequestArgumentBinderin interfaceRequestBinderRegistry- Parameters:
binder- The binder
-
findArgumentBinder
Description copied from interface:ArgumentBinderRegistryLocate anArgumentBinderfor the given argument.- Specified by:
findArgumentBinderin interfaceArgumentBinderRegistry<HttpRequest<?>>- Type Parameters:
T- The argument type- Parameters:
argument- The argument- Returns:
- An
OptionalofArgumentBinder
-
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
-