Package io.micronaut.core.bind
Interface ArgumentBinder<T,S>
-
- Type Parameters:
T
- The argument typeS
- The source type
- All Known Subinterfaces:
AnnotatedArgumentBinder<A,T,S>
,BeanPropertyBinder
,TypeArgumentBinder<T,S>
- All Known Implementing Classes:
AbstractAnnotatedArgumentBinder
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface ArgumentBinder<T,S>
An interface capable of binding the value of an
.Argument
from a sourceThe selection of an
ArgumentBinder
is done by theArgumentBinderRegistry
. Selection could be based on type, annotation or other factors such as the request media typeUnlike
TypeConverter
instances binders can potentially handle complex objects and typically work on conjunction with aConvertibleValues
instanceAn
ArgumentBinder
can either be registered as a bean or by META-INF/services. In the case of the latter it will be globally available at all times, whilst the former is only present when aio.micronaut.context.BeanContext
is initialized- Since:
- 1.0
- See Also:
TypeConverter
,ConvertibleValues
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ArgumentBinder.BindingResult<T>
The result of binding.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ArgumentBinder.BindingResult<T>
bind(ArgumentConversionContext<T> context, S source)
Bind the given argument from the given source.
-
-
-
Method Detail
-
bind
ArgumentBinder.BindingResult<T> bind(ArgumentConversionContext<T> context, S source)
Bind the given argument from the given source.- Parameters:
context
- TheArgumentConversionContext
source
- The source- Returns:
- An
Optional
of the value. If no binding was possibleOptional.empty()
-
-