users@jsr311.java.net

Re: MessageBodyWriter and annotations

From: Sergey Beryozkin <sergey.beryozkin_at_iona.com>
Date: Mon, 30 Jun 2008 16:55:25 +0100

Hi

>> Why should the runtime inject the annotations of the class? The class is available, so the runtime is not required to inject
>> them. If this is meant, we could IMO remove the Annotation[] parameter.
>>
> We could remove that parameter. I guess its mainly there for symmetry with MessageBodyReader - is this a big deal ?

I was actually expecting that a method-level annotation would be passed, it might provide some extra info for the provider to do its
job
Ex.

@XmlJavaTypeAdapter(IntegerUserMapAdapter.class)
Map<Integer, User> getUsers();

JAXBProvider may be able to do something if a method-level @XmlJavaTypeAdapter annotation is available.

I'm wondering then, would it make sense to keep the annotations params in place ?
Perhaps, passing method-level annotations instead would be ok, given that the class-level ones can be extracted from the actual
class ?

Cheers, Sergey

>
> Marc.
>
> ---
> Marc Hadley <marc.hadley at sun.com>
> CTO Office, Sun Microsystems.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net

----------------------------
IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland