Class PathVariableAnnotationBinder<T>
java.lang.Object
io.micronaut.core.bind.annotation.AbstractArgumentBinder<T>
io.micronaut.http.bind.binders.PathVariableAnnotationBinder<T>
- Type Parameters:
T-
- All Implemented Interfaces:
AnnotatedArgumentBinder<PathVariable, T, HttpRequest<?>>, ArgumentBinder<T, HttpRequest<?>>, AnnotatedRequestArgumentBinder<PathVariable, T>, RequestArgumentBinder<T>
public class PathVariableAnnotationBinder<T>
extends AbstractArgumentBinder<T>
implements AnnotatedRequestArgumentBinder<PathVariable, T>
Used for binding a parameter exclusively from a path variable.
- Since:
- 1.0.3
- Author:
- graemerocher
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface ArgumentBinder
ArgumentBinder.BindingResult<T> -
Field Summary
Fields inherited from class AbstractArgumentBinder
conversionService -
Constructor Summary
ConstructorsConstructorDescriptionPathVariableAnnotationBinder(ConversionService conversionService) PathVariableAnnotationBinder(ConversionService conversionService, Argument<T> argument) -
Method Summary
Modifier and TypeMethodDescriptionbind(ArgumentConversionContext<T> context, HttpRequest<?> source) Bind the given argument from the given source.protected StringgetParameterName(Argument<T> argument) Find the parameter name.Methods inherited from class AbstractArgumentBinder
doBind, doBind, doBind, doBind, doConvert, doConvert, doResolve, doResolve, getFallbackFormat, resolvedParameterNameMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface RequestArgumentBinder
createSpecific
-
Constructor Details
-
PathVariableAnnotationBinder
- Parameters:
conversionService- The conversion service
-
PathVariableAnnotationBinder
- Parameters:
conversionService- The conversion serviceargument- The argument
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationTypein interfaceAnnotatedArgumentBinder<PathVariable, T, HttpRequest<?>>- Returns:
- The annotation type.
-
bind
public ArgumentBinder.BindingResult<T> bind(ArgumentConversionContext<T> context, HttpRequest<?> source) Description copied from interface:ArgumentBinderBind the given argument from the given source.- Specified by:
bindin interfaceArgumentBinder<T, HttpRequest<?>>- Parameters:
context- TheArgumentConversionContextsource- The source- Returns:
- An
Optionalof the value. If no binding was possibleOptional.empty()
-
getParameterName
Description copied from class:AbstractArgumentBinderFind the parameter name.- Overrides:
getParameterNamein classAbstractArgumentBinder<T>- Parameters:
argument- The argument- Returns:
- The name
-