users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Re: Link.fromResource(Class<?> resource, String rel)

From: Jan Algermissen <jan.algermissen_at_nordsc.com>
Date: Thu, 18 Oct 2012 16:47:33 +0200

On Oct 18, 2012, at 4:12 PM, Santiago Pericas-Geertsen wrote:

>
> On Oct 18, 2012, at 9:57 AM, Santiago Pericas-Geertsen wrote:
>
>> Jan,
>>
>> You often have a different rel value for each resource method in a resource class (for example one with @GET and another with @PUT). The use of
>>
>> Link.Builder.fromResourceMethod(Class<?> resource, String method, String rel)
>>
>> does imply
>
> Sorry, "does not imply".
>
> -- Santiago
>
>> that the method must have an @Path annotation on it, so the @Path of the resource class will be used. Does this answer your questions?
>>

Oh, did not see that.

However, either way, I'd like to be able to do that without introspection, IOW, without the link support breaking when sbd hits 'rename' on the target method.

(I is also an actual user complaint I got yesterday)

Jan



>> -- Santiago
>>
>> On Oct 17, 2012, at 2:13 PM, Jan Algermissen wrote:
>>
>>> Hi,
>>>
>>> what about adding
>>>
>>>
>>> fromResource(Class<?> resource, String rel)
>>>
>>> to Link?
>>>
>>> It is IMHO not uncommon to have resource classes without sub resource methods.
>>>
>>> As it stands, there seems to be no way to use Link.fromXX to 'point' to such resource classes?
>>>
>>> Is that intentional? By accident? or am I missing something?
>>>
>>> Jan
>>
>