Package io.micronaut.http.bind.binders
Class HeaderAnnotationBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.HeaderAnnotationBinder<T>
- Type Parameters:
 T- A type
- All Implemented Interfaces:
 AnnotatedArgumentBinder<Header,,T, HttpRequest<?>> ArgumentBinder<T,,HttpRequest<?>> AnnotatedRequestArgumentBinder<Header,,T> RequestArgumentBinder<T>
public class HeaderAnnotationBinder<T>
extends AbstractArgumentBinder<T>
implements AnnotatedRequestArgumentBinder<Header,T> 
An 
AnnotatedArgumentBinder implementation that uses the Header
 annotation to trigger binding from an HTTP header.- Since:
 - 1.0
 - Author:
 - Graeme Rocher
 - See Also:
 
- 
Nested Class Summary
Nested classes/interfaces inherited from interface io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T> - 
Field Summary
Fields inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
conversionService - 
Constructor Summary
ConstructorsConstructorDescriptionHeaderAnnotationBinder(ConversionService conversionService) HeaderAnnotationBinder(ConversionService conversionService, Argument<T> argument)  - 
Method Summary
Modifier and TypeMethodDescriptionbind(ArgumentConversionContext<T> argument, HttpRequest<?> source) Bind the given argument from the given source.createSpecific(Argument<T> argument) Create a specific binder.protected StringgetFallbackFormat(Argument<?> argument) protected StringgetParameterName(Argument<T> argument) Find the parameter name.Methods inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
doBind, doBind, doBind, doBind, doConvert, doConvert, doResolve, doResolve, resolvedParameterName 
- 
Constructor Details
- 
HeaderAnnotationBinder
- Parameters:
 conversionService- The conversion service
 - 
HeaderAnnotationBinder
- Parameters:
 conversionService- The conversion serviceargument- The argument
 
 - 
 - 
Method Details
- 
createSpecific
Description copied from interface:RequestArgumentBinderCreate a specific binder.- Specified by:
 createSpecificin interfaceArgumentBinder<T,HttpRequest<?>> - Specified by:
 createSpecificin interfaceRequestArgumentBinder<T>- Parameters:
 argument- The bound argument- Returns:
 - The specific binder
 
 - 
bind
public ArgumentBinder.BindingResult<T> bind(ArgumentConversionContext<T> argument, HttpRequest<?> source) Description copied from interface:ArgumentBinderBind the given argument from the given source.- Specified by:
 bindin interfaceArgumentBinder<T,HttpRequest<?>> - Parameters:
 argument- TheArgumentConversionContextsource- The source- Returns:
 - An 
Optionalof the value. If no binding was possibleOptional.empty() 
 - 
getAnnotationType
- Specified by:
 getAnnotationTypein interfaceAnnotatedArgumentBinder<Header,T, HttpRequest<?>> - Returns:
 - The annotation type.
 
 - 
getParameterName
Description copied from class:AbstractArgumentBinderFind the parameter name.- Overrides:
 getParameterNamein classAbstractArgumentBinder<T>- Parameters:
 argument- The argument- Returns:
 - The name
 
 - 
getFallbackFormat
- Overrides:
 getFallbackFormatin classAbstractArgumentBinder<T>- Parameters:
 argument- The argument- Returns:
 - The fallback format
 
 
 -