Package io.micronaut.http.bind.binders
Class QueryValueArgumentBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.QueryValueArgumentBinder<T>
- Type Parameters:
T- The argument type
- All Implemented Interfaces:
io.micronaut.core.bind.annotation.AnnotatedArgumentBinder<QueryValue,,T, HttpRequest<?>> io.micronaut.core.bind.ArgumentBinder<T,,HttpRequest<?>> AnnotatedRequestArgumentBinder<QueryValue,,T> RequestArgumentBinder<T>
public class QueryValueArgumentBinder<T>
extends io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
implements AnnotatedRequestArgumentBinder<QueryValue,T>
A binder for binding arguments annotated with @QueryValue.
- Since:
- 2.0.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
io.micronaut.core.bind.ArgumentBinder.BindingResult<T extends Object> -
Field Summary
Fields inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
conversionService -
Constructor Summary
ConstructorsConstructorDescriptionQueryValueArgumentBinder(io.micronaut.core.convert.ConversionService conversionService) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.core.bind.ArgumentBinder.BindingResult<T>bind(io.micronaut.core.convert.ArgumentConversionContext<T> context, HttpRequest<?> source) Binds the argument withQueryValueannotation to the request (Also binds without annotation if request body is not permitted).Methods inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
doBind, doBind, doConvert, doConvert, doResolve, getFallbackFormat
-
Constructor Details
-
QueryValueArgumentBinder
public QueryValueArgumentBinder(io.micronaut.core.convert.ConversionService conversionService) Constructor.- Parameters:
conversionService- conversion service
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationTypein interfaceio.micronaut.core.bind.annotation.AnnotatedArgumentBinder<QueryValue,T, HttpRequest<?>>
-
bind
public io.micronaut.core.bind.ArgumentBinder.BindingResult<T> bind(io.micronaut.core.convert.ArgumentConversionContext<T> context, HttpRequest<?> source) Binds the argument withQueryValueannotation to the request (Also binds without annotation if request body is not permitted).It will first try to convert to ConvertibleMultiValues type and if conversion is successful, add the corresponding parameters to the request. (By default the conversion will be successful if the
Formatannotation is present and has one of the supported values - seeMultiValuesConverterFactoryfor specific converters). Otherwise, the uri template will be used to deduce what will be done with the request. For example, simple parameters are converted toString- Specified by:
bindin interfaceio.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>
-