IMO, the same is true with Readers.
@PUT
public void put(@Compression(0.2) Image image) {...}
@Compression should be passed in as the Reader's Annotation[]
Stephan Koops wrote:
> Hi,
>
> I agree with you, Bill, that it is good to give the resource method
> annotations.
>
> If they should not be this, the Annotation[] parameter could be removed.
>
> best regards
> Stephan
>
> Bill Burke schrieb:
>> Marc Hadley wrote:
>>> On Jun 30, 2008, at 11:21 AM, Sergey Beryozkin wrote:
>>>>
>>>> Consider this method :
>>>>
>>>> @AnnotationA
>>>> public Response get() {
>>>> return Response.ok().entity(new Foo()).build();
>>>> }
>>>>
>>>> @AnnotationB
>>>> public class Foo {}
>>>>
>>>> Which annotation should be passed to a given MessageBodyWriter
>>>> instance capable of serializing Foo ?
>>>> Is it @AnnotationB ?
>>>>
>>> Yes, AnnotationB.
>>>
>>
>> No, I don't agree with this. It should be @AnnotationA. If you don't
>> pass in the method's annotations, there is no way to do per method
>> configuration.
>>
>> For example:
>>
>> @Compression(0.2)
>> @Path("/myimage")
>> @GET
>> public Image get() {}
>>
>>
>> @Compression(1.0)
>> @Path("/anotherImage")
>> @GET
>> public Image getAnother() {}
>>
>> The @Compression annotation is my configuration annotation.
>>
>> Bill
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>
--
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com