Class RequestAttributeAnnotationBinder<T>

java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.RequestAttributeAnnotationBinder<T>
Type Parameters:
T - A type
All Implemented Interfaces:
io.micronaut.core.bind.annotation.AnnotatedArgumentBinder<RequestAttribute,T,HttpRequest<?>>, io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>, AnnotatedRequestArgumentBinder<RequestAttribute,T>, PostponedRequestArgumentBinder<T>, RequestArgumentBinder<T>

public class RequestAttributeAnnotationBinder<T> extends io.micronaut.core.bind.annotation.AbstractArgumentBinder<T> implements AnnotatedRequestArgumentBinder<RequestAttribute,T>, PostponedRequestArgumentBinder<T>
An AnnotatedArgumentBinder implementation that uses the RequestAttribute annotation to trigger binding from an HTTP request attribute. NOTE: The binder is annotating as postponed to allow injecting attributes added by filters.
  • Constructor Details

    • RequestAttributeAnnotationBinder

      public RequestAttributeAnnotationBinder(io.micronaut.core.convert.ConversionService conversionService)
      Parameters:
      conversionService - conversionService
    • RequestAttributeAnnotationBinder

      public RequestAttributeAnnotationBinder(io.micronaut.core.convert.ConversionService conversionService, io.micronaut.core.type.Argument<T> argument)
      Parameters:
      conversionService - conversionService
      argument - argument
  • Method Details

    • createSpecific

      public RequestArgumentBinder<T> createSpecific(io.micronaut.core.type.Argument<T> argument)
      Description copied from interface: RequestArgumentBinder
      Create a specific binder.
      Specified by:
      createSpecific in interface io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>
      Specified by:
      createSpecific in interface RequestArgumentBinder<T>
      Parameters:
      argument - The bound argument
      Returns:
      The specific binder
    • getAnnotationType

      public Class<RequestAttribute> getAnnotationType()
      Specified by:
      getAnnotationType in interface io.micronaut.core.bind.annotation.AnnotatedArgumentBinder<RequestAttribute,T,HttpRequest<?>>
    • bind

      public io.micronaut.core.bind.ArgumentBinder.BindingResult<T> bind(io.micronaut.core.convert.ArgumentConversionContext<T> argument, HttpRequest<?> source)
      Specified by:
      bind in interface io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>
    • getParameterName

      protected String getParameterName(io.micronaut.core.type.Argument<T> argument)
      Overrides:
      getParameterName in class io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
    • getFallbackFormat

      protected String getFallbackFormat(io.micronaut.core.type.Argument<?> argument)
      Overrides:
      getFallbackFormat in class io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>