Annotation Interface PathParam


@Documented @Retention(SOURCE) @Target(PARAMETER) public @interface PathParam

Binds the value of a URI path parameter as defined by URIBuilder to a Web route method parameter whose name indicates the name of the parameter.

The annotated parameter can be of any type as long as it can be decoded by a parameter converter.

When specifying a Web server route, a path parameter can be defined as optional when the method parameter is an Optional, it is otherwise considered as required and a MissingRequiredParameterException will be thrown if the route is invoked with the parameter missing.

A parameter converter may split a value around a value separator (eg. value 1,2,3,4 can be bound to a list of integers).


 @WebRoute( path = "/{requiredParameter}" )
 void handler(@PathParam int requiredParameter)

 @WebRoute( path = "/{optionalParameter}" )
 void handler(@QueryParam Optional<Integer> optionalParameter)

 @WebRoute( path = "/{multiValueParameter}" )
 void handler(@QueryParam List<Integer> multiValueParameter)
 
Since:
1.0
Author:
Jeremy Kuhn
See Also: