@Singleton public class DefaultRequestBinderRegistry extends Object implements RequestBinderRegistry
RequestBinderRegistry
interface.Constructor and Description |
---|
DefaultRequestBinderRegistry(ConversionService conversionService,
List<RequestArgumentBinder> binders) |
DefaultRequestBinderRegistry(ConversionService conversionService,
RequestArgumentBinder... binders) |
Modifier and Type | Method and Description |
---|---|
<T,ST> void |
addRequestArgumentBinder(ArgumentBinder<T,ST> binder)
Adds a request argument binder to the registry.
|
<T> Optional<ArgumentBinder<T,HttpRequest<?>>> |
findArgumentBinder(Argument<T> argument,
HttpRequest<?> source)
Locate an
ArgumentBinder for the given argument and source type. |
protected <T> RequestArgumentBinder |
findBinder(Argument<T> argument,
Class<? extends Annotation> annotationType) |
protected void |
registerDefaultAnnotationBinders(Map<Class<? extends Annotation>,RequestArgumentBinder> byAnnotation) |
protected void |
registerDefaultConverters(ConversionService<?> conversionService)
Registers a default converter.
|
public DefaultRequestBinderRegistry(ConversionService conversionService, RequestArgumentBinder... binders)
conversionService
- The conversion servicebinders
- The request argument binders@Inject public DefaultRequestBinderRegistry(ConversionService conversionService, List<RequestArgumentBinder> binders)
conversionService
- The conversion servicebinders
- The request argument binderspublic <T,ST> void addRequestArgumentBinder(ArgumentBinder<T,ST> binder)
ArgumentBinderRegistry
addRequestArgumentBinder
in interface ArgumentBinderRegistry<HttpRequest<?>>
T
- The argument typeST
- The source typebinder
- The binderpublic <T> Optional<ArgumentBinder<T,HttpRequest<?>>> findArgumentBinder(Argument<T> argument, HttpRequest<?> source)
ArgumentBinderRegistry
ArgumentBinder
for the given argument and source type.findArgumentBinder
in interface ArgumentBinderRegistry<HttpRequest<?>>
T
- The argument typeargument
- The argumentsource
- The sourceOptional
of ArgumentBinder
protected <T> RequestArgumentBinder findBinder(Argument<T> argument, Class<? extends Annotation> annotationType)
T
- The typeargument
- The argumentannotationType
- The class for annotationprotected void registerDefaultConverters(ConversionService<?> conversionService)
conversionService
- The conversion serviceprotected void registerDefaultAnnotationBinders(Map<Class<? extends Annotation>,RequestArgumentBinder> byAnnotation)
byAnnotation
- The request argument binder