Package io.micronaut.http.bind.binders
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 io.micronaut.core.bind.ArgumentBinder
ArgumentBinder.BindingResult<T>
-
Field Summary
Fields inherited from class io.micronaut.core.bind.annotation.AbstractArgumentBinder
conversionService
-
Constructor Summary
ConstructorDescriptionPathVariableAnnotationBinder
(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 String
getParameterName
(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, getFallbackFormat, resolvedParameterName
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.RequestArgumentBinder
createSpecific
-
Constructor Details
-
PathVariableAnnotationBinder
- Parameters:
conversionService
- The conversion service
-
PathVariableAnnotationBinder
- Parameters:
conversionService
- The conversion serviceargument
- The argument
-
-
Method Details
-
getAnnotationType
- Specified by:
getAnnotationType
in interfaceAnnotatedArgumentBinder<PathVariable,
T, HttpRequest<?>> - Returns:
- The 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()
-
getParameterName
Description copied from class:AbstractArgumentBinder
Find the parameter name.- Overrides:
getParameterName
in classAbstractArgumentBinder<T>
- Parameters:
argument
- The argument- Returns:
- The name
-