jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: Where to put annotations like DefaultValue when injection of request parameters is done via setters ?

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Thu, 13 Mar 2014 11:08:02 +0000

FYI:

https://java.net/jira/browse/JAX_RS_SPEC-450

Thanks, Sergey
On 12/03/14 22:10, Sergey Beryozkin wrote:
> Hi
>
> What is the right way to specify the annotation like DefaultValue when
> injecting the parameters via setters, is it
>
> (1)
>
> public class Root {
> @QueryParam("id")
> @DefaultValue("1")
> public setId(String id) {}
> }
>
> or
>
> (2)
>
> public class Root {
> @QueryParam("id")
> public setId(@DefaultValue("1") String id) {}
> }
>
> or either (1) or (2).
>
> Should API clarify it ? I can open a minor 2.1 issue
>
> Sergey