users@jsr311.java.net

Re: MessageBodyWriter and annotations

From: Stephan Koops <Stephan.Koops_at_web.de>
Date: Mon, 30 Jun 2008 17:25:52 +0200

Hi Sergey,

I think ever the ones of the resource method -> @AnnotationA. Perhaps it
is not clear enough.

Marc, the javadoc refers to the creation from a field? I think the only
way to return objects are the resource methods.

best regards
   Stephan

Sergey Beryozkin schrieb:
> Hi
>
> 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 ?
>
> Thanks, Sergey