dev@jsr311.java.net

RE: "Dual dispatch"

From: Jerome Louvel <jerome.louvel_at_noelios.com>
Date: Tue, 24 Apr 2007 10:16:39 +0200

Hi all,

I think I generally agree with Stephan on his comments here (SPI vs API, way
to register serialization handlers). I just feel like it is a bit too early
to dive too much into this area yet. I would prefer to refer a consensus on
higher-level aspects first.

Best regards,
Jerome

> -----Message d'origine-----
> De : Paul.Sandoz_at_Sun.COM [mailto:Paul.Sandoz_at_Sun.COM]
> Envoyé : lundi 23 avril 2007 11:43
> À : dev_at_jsr311.dev.java.net
> Objet : Re: "Dual dispatch"
>
> Hi,
>
> Just a clarification about support JAXB beans via a type
> serializer as i
> am not sure it is evident from the email discussion.
>
> It is not strictly necessary to register a type provider for
> each JAXB
> bean. The JAXB type provider can check if the a Java type has the
> @XmlElement annotation declared on it. Such a provider could be the
> default provider for any MIME type used with a JAXB bean.
>
>
> Stefan Tilkov wrote:
> > My suggestion is to add a feature for this to the registry
> - i.e. the
> > key to find the right type serializer should not only be
> the type, but
> > also the media type (or only one of them).
>
> I agree. I think the developer should be able to override default
> behavior supported by 311.
>
>
> > For example, the default way
> > to convert objects to and from XML would be JAXB when the JAXB
> > serializer is registered for application/xml.
>
> Or any MIME type? e.g. application/foo+xml
>
>
> > For a type Person, I could
> > register a handler for {Person.class, "text/x-vcard"}, for
> > {"application/json"}, some generic Object-to-JSON mapper.
> >
>
> +1
>
> Paul.
> --
> | ? + ? = To question
> ----------------\
> Paul Sandoz
> x38109
> +33-4-76188109
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: dev-help_at_jsr311.dev.java.net
>