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

    Constructors
    Constructor
    Description
    QueryValueArgumentBinder(io.micronaut.core.convert.ConversionService conversionService)
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.core.bind.ArgumentBinder.BindingResult<T>
    bind(io.micronaut.core.convert.ArgumentConversionContext<T> context, HttpRequest<?> source)
    Binds the argument with QueryValue annotation 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • QueryValueArgumentBinder

      public QueryValueArgumentBinder(io.micronaut.core.convert.ConversionService conversionService)
      Constructor.
      Parameters:
      conversionService - conversion service
  • Method Details

    • getAnnotationType

      public Class<QueryValue> getAnnotationType()
      Specified by:
      getAnnotationType in interface io.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 with QueryValue annotation 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 Format annotation is present and has one of the supported values - see MultiValuesConverterFactory for specific converters). Otherwise, the uri template will be used to deduce what will be done with the request. For example, simple parameters are converted to String

      Specified by:
      bind in interface io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>