On Jan 5, 2009, at 7:30 PM, Marc Hadley wrote:
> On Jan 5, 2009, at 10:52 AM, Reto Bachmann-Gmür wrote:
>>
>> As I understand section 4.2.2 and 4.2.3 the MBW are sorted only
>> based on
>> the concreteness of the produced media-type.
>
> Right.
>
>> I'm wondering why the
>> closeness of the java-type seems not to play a role: say we have a
>> class
>> Person that is a subclass of Agent and writers for both classes,
>> shouldn't a jax-rs implementation always select the Person writer
>> when a
>> method returns a Person. As I understand the spec it is not
>> determined
>> which writer is selected.
>>
> Hmm, I can't recall why we didn't do that for MBW but did for
> ExceptionMappers, Paul do you remember ?
>
It did not occur to us. I think it a good idea. As it solves the
issue of the Agent consuming all instances if the isWritable does the
following:
return Agent.class.isAssignableFrom(clazz);
Paul.