Enumerable values can be used in JAX-RS rest service parameters
annotated by @PathParam
, @QueryParam
, @MatrixParam
, @CookieParam
and @HeaderParam
.
For a less technical description of JAX-RS please see the corresponding wikipedia article.
Add the following dependency to your project or download it from maven central.
<dependency>
<groupId>nl.talsmasoftware.enumerables</groupId>
<artifactId>enumerables-jaxrs</artifactId>
<version>[see maven-central badge]</version>
</dependency>
The EnumerableParamConverterProvider
is annotated with @Provider
so if it is managed by a Java-EE loader
it should be automatically picked up by your JAX-RS implementation.
In non-Java-EE environments it may be necessary to explicitly register the
provider class to the JAX-RS implementation you use.