Re: Proposal for rework of spi package (was Re: "Dual dispatch")

From: Stefan Tilkov <>
Date: Thu, 26 Apr 2007 16:30:27 +0200

On Apr 26, 2007, at 4:14 PM, Marc Hadley wrote:

> I'd only expect generic type providers like a JAXB provider or a
> String provider to omit the type property in the @Externalizer
> annotation since they don't much care what the media type is, they
> just read and write the data regardless.

I don't understand this. In the example you gave

> @Externalizer(classes={Thing.class}, type="application/thing")
> public class ThingExternalizer implements
> TypeStreamingProvider<Thing.class> {...}

I would say it's more likely that the classes (e.g. Thing.class) is
left out, not the type ("application/thing") - i.e. a generic
serializer may be able to serialize all Java classes to "application/
json" or "application/xml".
(Additionally, maybe type should better be called "mediatype" or