Package io.micronaut.http.client.bind
Class DefaultHttpClientBinderRegistry
- java.lang.Object
-
- io.micronaut.http.client.bind.DefaultHttpClientBinderRegistry
-
- All Implemented Interfaces:
HttpClientBinderRegistry
@Singleton @Internal public class DefaultHttpClientBinderRegistry extends java.lang.Object implements HttpClientBinderRegistry
Default implementation ofHttpClientBinderRegistrythat searches by annotation then by type.- Since:
- 2.1.0
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedDefaultHttpClientBinderRegistry(io.micronaut.core.convert.ConversionService<?> conversionService, java.util.List<ClientRequestBinder> binders, io.micronaut.context.BeanContext beanContext)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> voidaddBinder(ClientRequestBinder binder)Adds a binder to the registry.java.util.Optional<AnnotatedClientRequestBinder<?>>findAnnotatedBinder(java.lang.Class<?> annotationType)Locate anAnnotatedClientRequestBinderfor a given annotation type (that is supposed to be applied to the method).<T> java.util.Optional<ClientArgumentRequestBinder<?>>findArgumentBinder(io.micronaut.core.type.Argument<T> argument)Locate anClientArgumentRequestBinderfor the given argument.
-
-
-
Constructor Detail
-
DefaultHttpClientBinderRegistry
protected DefaultHttpClientBinderRegistry(io.micronaut.core.convert.ConversionService<?> conversionService, java.util.List<ClientRequestBinder> binders, io.micronaut.context.BeanContext beanContext)- Parameters:
conversionService- The conversion servicebinders- The request bindersbeanContext- The context to resolve beans
-
-
Method Detail
-
findArgumentBinder
public <T> java.util.Optional<ClientArgumentRequestBinder<?>> findArgumentBinder(@NonNull io.micronaut.core.type.Argument<T> argument)
Description copied from interface:HttpClientBinderRegistryLocate anClientArgumentRequestBinderfor the given argument.- Specified by:
findArgumentBinderin interfaceHttpClientBinderRegistry- Type Parameters:
T- The argument type- Parameters:
argument- The argument- Returns:
- An
OptionalofClientArgumentRequestBinder
-
findAnnotatedBinder
public java.util.Optional<AnnotatedClientRequestBinder<?>> findAnnotatedBinder(@NonNull java.lang.Class<?> annotationType)
Description copied from interface:HttpClientBinderRegistryLocate anAnnotatedClientRequestBinderfor a given annotation type (that is supposed to be applied to the method).- Specified by:
findAnnotatedBinderin interfaceHttpClientBinderRegistry- Parameters:
annotationType- - the type of annotation- Returns:
- An
OptionalofAnnotatedClientRequestBinder
-
addBinder
public <T> void addBinder(ClientRequestBinder binder)
Adds a binder to the registry.- Type Parameters:
T- The type- Parameters:
binder- The binder
-
-