jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] Re: [jax-rs-spec users] MessageBodyWriter Class parameter

From: Santiago Pericas-Geertsen <Santiago.PericasGeertsen_at_oracle.com>
Date: Tue, 9 Oct 2012 10:40:35 -0400

Sergey,

> @GET
> public Book getBook() {
> if (something) {
> return SuperBook();
> } else {
> return SuperBook2();
> }
> }

 I'm assuming you mean "sub" not "super" here.

> I reckon in writeTo() it can make sense to get the return class reported by a given method to pass directly to writeTo, so that the provider can see that the first class parameter is 'Book.class', while the instance class is object.getClass().

 Without discussing the technical issue any further, this is not a backward compatible change, right? What about injecting ResourceInfo in 2.0 and getting the type from there?

-- Santiago