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 the parameter converter injected in the web server module.

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.

The 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}" )
 public void handler(@PathParam int requiredParameter) {
     ...
 }

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

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