camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: Xstream marshalling & Alias
Date Wed, 22 Oct 2008 11:51:55 GMT
2008/10/22 cmoulliard <cmoulliard@gmail.com>:
>
> Many thanks.
>
> In this case, it will be required that I create my own format
> (XSTreamDataFormat) like this o use annotation :
>
>                XStream xstream = new XStream();
>                xstream.processAnnotations(StockPrice.class);
>                XStreamDataFormat myformat = new XStreamDataFormat();
>                myformat.setXStream(xstream);
>
>                from("direct:in").marshal(myformat).to("mock:result");


Do you have to tell XStream which classes to look for annotations? I'd
have thought, like JAXB, it'd just look for the annotations by default
on whatever classes it was marshalling. But I guess for unmarshalling
it needs to know (rather like the JAXBContext needs to know the
classes/packages)

> Remark :
>
> It should be interesting to use the xstream dataformat with a parameter
> indicating that XStream must process annotation
> from("").marshal().xstream().processAnnotation().to("") to avoid to create
> its own DataFormat ?

I think like JAXB, we'd just need to create the XStreamDataFormat
explicitly using whatever configuration is required

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://fusesource.com/

Mime
View raw message