Class DefaultRequestBinderRegistry

java.lang.Object
io.micronaut.http.bind.DefaultRequestBinderRegistry
All Implemented Interfaces:
io.micronaut.core.bind.ArgumentBinderRegistry<HttpRequest<?>>, RequestBinderRegistry

@Singleton public class DefaultRequestBinderRegistry extends Object implements RequestBinderRegistry
Default implementation of the RequestBinderRegistry interface.
Since:
1.0
  • Constructor Details

    • DefaultRequestBinderRegistry

      public DefaultRequestBinderRegistry(io.micronaut.core.convert.ConversionService conversionService, RequestArgumentBinder... binders)
      Parameters:
      conversionService - The conversion service
      binders - The request argument binders
    • DefaultRequestBinderRegistry

      public DefaultRequestBinderRegistry(io.micronaut.core.convert.ConversionService conversionService, List<RequestArgumentBinder> binders)
    • DefaultRequestBinderRegistry

      @Inject public DefaultRequestBinderRegistry(io.micronaut.core.convert.ConversionService conversionService, List<RequestArgumentBinder> binders, DefaultBodyAnnotationBinder bodyAnnotationBinder)
      Parameters:
      conversionService - The conversion service
      binders - The request argument binders
      bodyAnnotationBinder - The body annotation binder
  • Method Details

    • addArgumentBinder

      public <T> void addArgumentBinder(io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>> binder)
      Specified by:
      addArgumentBinder in interface io.micronaut.core.bind.ArgumentBinderRegistry<HttpRequest<?>>
    • addUnmatchedRequestArgumentBinder

      public void addUnmatchedRequestArgumentBinder(RequestArgumentBinder<Object> binder)
      Description copied from interface: RequestBinderRegistry
      Adds a request argument binder that will be used to match the argument that wasn't matched by a type or an annotation.
      Specified by:
      addUnmatchedRequestArgumentBinder in interface RequestBinderRegistry
      Parameters:
      binder - The binder
    • findArgumentBinder

      public <T> Optional<io.micronaut.core.bind.ArgumentBinder<T,HttpRequest<?>>> findArgumentBinder(io.micronaut.core.type.Argument<T> argument)
      Specified by:
      findArgumentBinder in interface io.micronaut.core.bind.ArgumentBinderRegistry<HttpRequest<?>>
    • findBinder

      protected <T> RequestArgumentBinder findBinder(io.micronaut.core.type.Argument<T> argument, Class<? extends Annotation> annotationType)
      Type Parameters:
      T - The type
      Parameters:
      argument - The argument
      annotationType - The class for annotation
      Returns:
      The request argument binder
    • registerDefaultAnnotationBinders

      protected void registerDefaultAnnotationBinders(Map<Class<? extends Annotation>,RequestArgumentBinder> byAnnotation)
      Parameters:
      byAnnotation - The request argument binder