Class AbstractArgumentBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
- Type Parameters:
T
- The argument type
- Direct Known Subclasses:
AbstractAnnotatedArgumentBinder
,CookieAnnotationBinder
,DefaultBodyAnnotationBinder
,HeaderAnnotationBinder
,PathVariableAnnotationBinder
,QueryValueArgumentBinder
,RequestAttributeAnnotationBinder
An abstract
AnnotatedArgumentBinder
implementation.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractArgumentBinder
(ConversionService conversionService) Constructor.protected
AbstractArgumentBinder
(ConversionService conversionService, Argument<T> argument) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected ArgumentBinder.BindingResult<T>
doBind
(ArgumentConversionContext<T> context, ConvertibleValues<?> values) Do binding.protected ArgumentBinder.BindingResult<T>
doBind
(ArgumentConversionContext<T> context, ConvertibleValues<?> values, ArgumentBinder.BindingResult<T> defaultResult) Do binding.protected ArgumentBinder.BindingResult<T>
doBind
(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name) Do binding.protected ArgumentBinder.BindingResult<T>
doBind
(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name, ArgumentBinder.BindingResult<T> defaultResult) Do binding.protected ArgumentBinder.BindingResult<T>
doConvert
(Object value, ArgumentConversionContext<T> context) Convert the value and return a binding result.protected ArgumentBinder.BindingResult<T>
doConvert
(Object value, ArgumentConversionContext<T> context, ArgumentBinder.BindingResult<T> defaultResult) Convert the value and return a binding result.doResolve
(ArgumentConversionContext<T> context, ConvertibleValues<?> values) Do resolve.doResolve
(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name) Do resolve.protected String
getFallbackFormat
(Argument<?> argument) getParameterName
(@NonNull Argument<T> argument) Find the parameter name.protected final String
resolvedParameterName
(Argument<T> argument) Returns resolved parameter name usinggetParameterName(Argument)
or pre-resolved.
-
Field Details
-
conversionService
-
-
Constructor Details
-
AbstractArgumentBinder
Constructor.- Parameters:
conversionService
- conversionService
-
AbstractArgumentBinder
Constructor.- Parameters:
conversionService
- conversionServiceargument
- The argument
-
-
Method Details
-
doBind
protected ArgumentBinder.BindingResult<T> doBind(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name) Do binding.- Parameters:
context
- contextvalues
- valuesname
- name- Returns:
- result
-
doBind
protected ArgumentBinder.BindingResult<T> doBind(ArgumentConversionContext<T> context, ConvertibleValues<?> values) Do binding.- Parameters:
context
- contextvalues
- values- Returns:
- result
-
doBind
protected ArgumentBinder.BindingResult<T> doBind(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name, ArgumentBinder.BindingResult<T> defaultResult) Do binding.- Parameters:
context
- contextvalues
- valuesname
- annotationValuedefaultResult
- The default binding result if the value is null- Returns:
- result
-
doBind
protected ArgumentBinder.BindingResult<T> doBind(ArgumentConversionContext<T> context, ConvertibleValues<?> values, ArgumentBinder.BindingResult<T> defaultResult) Do binding.- Parameters:
context
- contextvalues
- valuesdefaultResult
- The default binding result if the value is null- Returns:
- result
- Since:
- 4.8
-
getParameterName
Find the parameter name.- Parameters:
argument
- The argument- Returns:
- The name
- Since:
- 4.8
-
resolvedParameterName
Returns resolved parameter name usinggetParameterName(Argument)
or pre-resolved.- Parameters:
argument
- The argument.- Returns:
- The parameter name
- Since:
- 4.8
-
doResolve
@Nullable protected @Nullable Object doResolve(ArgumentConversionContext<T> context, ConvertibleValues<?> values, String name) Do resolve.- Parameters:
context
- contextvalues
- valuesname
- annotationValue- Returns:
- result
-
doResolve
@Nullable protected @Nullable Object doResolve(ArgumentConversionContext<T> context, ConvertibleValues<?> values) Do resolve.- Parameters:
context
- contextvalues
- values- Returns:
- result
- Since:
- 4.8
-
getFallbackFormat
- Parameters:
argument
- The argument- Returns:
- The fallback format
-
doConvert
protected ArgumentBinder.BindingResult<T> doConvert(Object value, ArgumentConversionContext<T> context) Convert the value and return a binding result.- Parameters:
value
- The value to convertcontext
- The conversion context- Returns:
- The binding result
-
doConvert
protected ArgumentBinder.BindingResult<T> doConvert(Object value, ArgumentConversionContext<T> context, ArgumentBinder.BindingResult<T> defaultResult) Convert the value and return a binding result.- Parameters:
value
- The value to convertcontext
- The conversion contextdefaultResult
- The binding result if the value is null- Returns:
- The binding result
-