Re: ProduceMime and ConsumeMime

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Mon, 09 Apr 2007 09:53:37 -0400

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:

public Respresentation<String> getString(@MediaType("text/plain")
String text)

or even

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 Hadley <marc.hadley at>
CTO Office, Sun Microsystems.