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
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 io.micronaut.core.bind.annotation.AbstractArgumentBinder
doBind, doBind, doBind, doBind, doConvert, doConvert, doResolve, doResolve, getFallbackFormat, resolvedParameterNameMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
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
-