Validation of method parameters
- by Anton Tsivarev
I have a RESTful web service. For implementation using JAX-RS (Jersey).
Have the following method:
public void foo (@PathParam ("name") String uuid) {
...
}
I need to do validation of input parameters. And if data invalid throw WebApplicationException.
I added my custom annotation CheckUuid (extends ):
public void foo (@PathParam ("name") @CheckUuid String uuid) {
...
}
Is it possible to do validation using annotations on a stage when the method chosen, but not yet called? For example using PreProcessInterceptor?