Package io.micronaut.http.bind.binders
Class DefaultBodyAnnotationBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.DefaultBodyAnnotationBinder<T>
- Type Parameters:
T
- A type
- All Implemented Interfaces:
AnnotatedArgumentBinder<Body,
,T, HttpRequest<?>> ArgumentBinder<T,
,HttpRequest<?>> AnnotatedRequestArgumentBinder<Body,
,T> BodyArgumentBinder<T>
,PostponedRequestArgumentBinder<T>
,RequestArgumentBinder<T>
public class DefaultBodyAnnotationBinder<T>
extends AbstractArgumentBinder<T>
implements BodyArgumentBinder<T>, PostponedRequestArgumentBinder<T>
Binds a String body argument.
- Since:
- 1.0
- Author:
- Graeme Rocher
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T>
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbind
(ArgumentConversionContext<T> context, HttpRequest<?> source) Bind the given argument from the given source.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
Methods inherited from interface io.micronaut.http.bind.binders.PostponedRequestArgumentBinder
bindPostponed
-
Field Details
-
conversionService
-
-
Constructor Details
-
DefaultBodyAnnotationBinder
- Parameters:
conversionService
- The conversion service
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceAnnotatedArgumentBinder<Body,
T, HttpRequest<?>> - Specified by:
getAnnotationType
in interfaceBodyArgumentBinder<T>
- Returns:
- The required annotation type
-
bind
public ArgumentBinder.BindingResult<T> bind(ArgumentConversionContext<T> context, HttpRequest<?> source) Description copied from interface:ArgumentBinder
Bind the given argument from the given source.- Specified by:
bind
in interfaceArgumentBinder<T,
HttpRequest<?>> - Parameters:
context
- TheArgumentConversionContext
source
- The source- Returns:
- An
Optional
of the value. If no binding was possibleOptional.empty()
-