users@jersey.java.net

Re: [Jersey] FW: xml schema in request and response (wadl)

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 06 Nov 2009 10:54:19 +0100

On Nov 5, 2009, at 4:10 PM, Marc Hadley wrote:
>>
>> I was more thinking of a generic interface that is implemented to
>> derive the qname from the JAXB bean or any XML related artifact,
>> rather than explicitly declaring Qnames on readers/writers. As we
>> don't want developers to have to write their own message body
>> writers for common functionality. Thus the qname for 1) is can be
>> obtained via the generic functionality on the JAXB readers/writers.
>>
> Is the reason for tying this to readers/writer that you could re-use
> the existing isReadable/isWritable method to locate the correct
> provider to query ?

Yes, although having thought some more i am uncertain if the readers/
writers can be used reliably utilized and we may require another
generic mechanism.


> This only works when the entity type is statically available though,
> for Response return types or types like Object you'd still need an
> annotation to supply the necessary QName.
>

I was thinking instead of a specific annotation for declaring the
qname the annotation could declare the type of the response entity.
However, Type is an invalid Java type for an annotation member :-
( thus it would not be possible to do:

   @ResponseEntityType(List<Class>)


Paul.