camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: camel-xstream ... package aliasing possible?
Date Tue, 24 Aug 2010 12:35:41 GMT
Here is an example from the camel-xstream unit test.

XStreamDataFormat xstreamDefinition = new XStreamDataFormat();
Map<String, String> aliases = new HashMap<String, String>();
aliases.put("purchase-order", PurchaseOrder.class.getName());
xstreamDefinition.setAliases(aliases);

  List<String> converters = new ArrayList<String>();
  converters.add(PurchaseOrderConverter.class.getName());
  converters.add(CheckMethodInjection.class.getName());
  converters.add(CheckConstructorInjection.class.getName());

xstreamDefinition.setConverters(converters);

from("direct:marshal").marshal(xstreamDefinition).to("mock:result");
 
from("direct:unmarshal").unmarshal(xstreamDefinition).to("mock:result");

Willem

Mond Raymond wrote:
> I see the source and the JIRA reflecting the fact that the code should
> support more Xstream converters / aliases.  All good. 
> 
> One small thing... I would just like to tweak the output to tweak the
> package name. 
> 
> In Xstream I can do the following: 
> 
>         XStream xstream = new XStream(); 
>         xstream.aliasPackage("com", "com.blah.blah"); 
> 
> Although I cannot find a direct way to do this in the API, is there a
> possibility with a bit of hacking to achieve this result?  Essentially I
> would like to provide my own xstream instance... 
> 
> Thanks in advance 
> 
> Ray 


Mime
View raw message