On Apr 7, 2007, at 1:21 AM, Dhanji R. Prasanna wrote:
>
> I thought that the annotation on the entity parameter was a good
> way to indicate consumption type.
> Btw, will this JSR be able to take advantage of JSR 308 to do
> something like:
>
> @HttpMethod
> public Representation<@MediaType("text/xml") String> getString
> (@MediaType("text/raw") String text) {
> //...
> }
>
Requiring JSR 308 would tie us to Java SE 7 which I think would be a
mistake. Allowing it as an alternative might be OK. I'm curious
though whether the above is any more expressive/desirable than:
@HttpMethod
@MediaType("text/xml")
public Respresentation<String> getString(@MediaType("text/plain")
String text)
or even
@HttpMethod
@ProduceMime("text/xml")
@ConsumeMime("text/plain")
public Respresentation<String> getString(String text)
>
> Marc, I also like your idea of tagging classes with "global"
> mimetypes, I certainly think there is a case for that to reduce
> verbosity.
> I would encourage different names at the class level though, to
> dispel confusion about annotations appearing in several places.
>
I don't know, is having two different annotations that perform the
same function in two different places less confusing that one
annotation that performs the same function in two different places ?
Marc.
---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.
- application/pkcs7-signature attachment: smime.p7s