[CONF] Apache Camel XStream

2014-07-25 Thread willem jiang (Confluence)














  


willem jiang edited the page:
 


XStream   






...



 Code Block




 XStream xStream = new XStream();
xStream.aliasField(money, PurchaseOrder.class, cash);
// new Added setModel option since Camel 2.14
xStream.setModel(NO_REFERENCES);
...

from(direct:marshal).
  marshal(new XStreamDataFormat(xStream)).
  to(mock:marshaled);
 



...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Camel XStream

2014-04-09 Thread Henryk Konsek (Confluence)














  


Henryk Konsek edited the page:
 


XStream   




 Comment: Added more XStream Java DSL examples 


...



 Code Block




 // lets turn Object messages into XML then send to MQSeries
from(activemq:My.Queue).
  marshal().xstream().
  to(mqseries:Another.Queue);
 



 If you would like to configure the XStream instance used by the Camel for the message transformation, you can simply pass a reference to that instance on the DSL level. 



 Code Block




 
XStream xStream = new XStream();
xStream.aliasField(money, PurchaseOrder.class, cash);

...

from(direct:marshal).
  marshal(new XStreamDataFormat(xStream)).
  to(mock:marshaled);

 



XMLInputFactory and XMLOutputFactory
...






 View Online   Like   View Changes  
 Stop watching space   Manage Notifications  


 


 


  This message was sent by Atlassian Confluence 5.0.3, Team Collaboration Software  






[CONF] Apache Camel XStream

2014-03-04 Thread Carsten Ringe (Confluence)














  


Carsten Ringe bearbeitete die Seite:
 


XStream   




 Kommentar: move maven dependency to the top, like other pages 


...
XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML.
 To use XStream in your camel routes you need to add the a dependency oncamel-xstreamwhich implements this data format. 
 Maven users will need to add the following dependency to their pom.xmlfor this component: 



 Codeblock








language
xml


 




 
dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-xstream/artifactId
  versionx.x.x/version
  !-- use the same version as your Camel core version --
/dependency

 






 Codeblock




 
// lets turn Object messages into XML then send to MQSeries
from(activemq:My.Queue).
  marshal().xstream().
  to(mqseries:Another.Queue);
 



...
From Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME, or setting the encoding property on Xstream from DSL or Spring config.



 Codeblock
  

[CONF] Apache Camel XStream

2014-03-04 Thread Carsten Ringe (Confluence)














  


Carsten Ringe bearbeitete die Seite:
 


XStream   




 Kommentar: add headline above codeblock 


...



 Codeblock








language
xml


 




 dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-xstream/artifactId
  versionx.x.x/version
  !-- use the same version as your Camel core version --
/dependency
 



 Using the Java DSL 



 Codeblock




 // lets turn Object messages into XML then send to MQSeries
from(activemq:My.Queue).
  marshal().xstream().
  to(mqseries:Another.Queue);
 



...






 Online anzeigen   Gefllt mir   nderungen anzeigen  
 berwachung des Bereichs beenden   Benachrichtigungen verwalten  


 


 


  Diese Nachricht wurde von Atlassian Confluence 5.0.3, der Kollaborationssoftware fr Teams, gesendet  






[CONF] Apache Camel XStream

2010-09-13 Thread confluence







XStream
Page edited by willem jiang


 Changes (0)
 



...
 h3. XMLInputFactory and XMLOutputFactory  
[The XStream library|http://xstream.codehaus.org/] uses the {{javax.xml.stream.XMLInputFactory}} and {{javax.xml.stream.XMLOutputFactory}},  you can control which implementation of this factory should be used. 
 The Factory is discovered using this algorithm: 
...

Full Content

XStream

XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML.



// lets turn Object messages into XML then send to MQSeries
from("activemq:My.Queue").
  marshal().xstream().
  to("mqseries:Another.Queue");



XMLInputFactory and XMLOutputFactory 
The XStream library uses the javax.xml.stream.XMLInputFactory and javax.xml.stream.XMLOutputFactory,  you can control which implementation of this factory should be used.

The Factory is discovered using this algorithm:
1. Use the javax.xml.stream.XMLInputFactory , javax.xml.stream.XMLOutputFactory system property.
2. Use the lib/xml.stream.properties file in the JRE_HOME directory.
3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLInputFactory, META-INF/services/javax.xml.stream.XMLOutputFactory  files in jars available to the JRE.
4. Use the platform default XMLInputFactory,XMLOutputFactory instance.

How to set the XML encoding in Xstream DataFormat?
From Camel 1.6.3 or Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME, or setting the encoding property on Xstream from DSL or Spring config.


from("activemq:My.Queue").
  marshal().xstream("UTF-8").
  to("mqseries:Another.Queue");




camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"

!-- we define the json xstream data formats to be used (xstream is default) --
dataFormats
xstream id="xstream-utf8" encoding="UTF-8"/
xstream id="xstream-default"/
/dataFormats

route
from uri="direct:in"/
marshal ref="xstream-default"/
to uri="mock:result"/
/route

route
from uri="direct:in-UTF-8"/
marshal ref="xstream-utf8"/
to uri="mock:result"/
/route

/camelContext



Dependencies

To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format. 

If you use maven you could just add the following to your pom.xml, substituting the version number for the latest  greatest release (see the download page for the latest versions).



dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-xstream/artifactId
  version1.5.0/version
/dependency






Change Notification Preferences

View Online
|
View Changes
|
Add Comment









[CONF] Apache Camel XStream

2010-01-29 Thread confluence







 XStream
 Page edited by willem jiang

 CAMEL-2407
  
 CAMEL-2407
 
  
 
 XStream

XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML.



// lets turn Object messages into XML then send to MQSeries
from("activemq:My.Queue").
  marshal().xstream().
  to("mqseries:Another.Queue");



XMLInputFactory and XMLOutputFactory 
The XStream library|http://xstream.codehaus.org/] uses the javax.xml.stream.XMLInputFactory and javax.xml.stream.XMLOutputFactory,  you can control which implementation of this factory should be used.

The Factory is discovered using this algorithm:
1. Use the javax.xml.stream.XMLInputFactory , javax.xml.stream.XMLOutputFactory system property.
2. Use the lib/xml.stream.properties file in the JRE_HOME directory.
3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLInputFactory, META-INF/services/javax.xml.stream.XMLOutputFactory  files in jars available to the JRE.
4. Use the platform default XMLInputFactory,XMLOutputFactory instance.

How to set the XML encoding in Xstream DataFormat?
From Camel 1.6.3 or Camel 2.2.0, you can set the encoding of XML in Xstream DataFormat by setting the Exchange's property with the key Exchange.CHARSET_NAME, or setting the encoding property on Xstream from DSL or Spring config.


from("activemq:My.Queue").
  marshal().xstream("UTF-8").
  to("mqseries:Another.Queue");




camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"

!-- we define the json xstream data formats to be used (xstream is default) --
dataFormats
xstream id="xstream-utf8" encoding="UTF-8"/
xstream id="xstream-default"/
/dataFormats

route
from uri="direct:in"/
marshal ref="xstream-default"/
to uri="mock:result"/
/route

route
from uri="direct:in-UTF-8"/
marshal ref="xstream-utf8"/
to uri="mock:result"/
/route

/camelContext



Dependencies

To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format. 

If you use maven you could just add the following to your pom.xml, substituting the version number for the latest  greatest release (see the download page for the latest versions).



dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-xstream/artifactId
  version1.5.0/version
/dependency



 
 
   
Change Notification Preferences
   

   View Online
   |
   View Change
  |
   Add Comment









[CONF] Apache Camel: XStream (page edited)

2009-01-21 Thread confluence










Page Edited :
CAMEL :
XStream



 
XStream
has been edited by Claus Ibsen
(Jan 21, 2009).
 

 
 (View changes)
 

Content:
XStream

XStream is a Data Format which uses the XStream library to marshal and unmarshal Java objects to and from XML.


// lets turn Object messages into XML then send to MQSeries
from("activemq:My.Queue").
  marshal().xstream().
  to("mqseries:Another.Queue");


XMLInputFactory and XMLOutputFactory 
The XStream library|http://xstream.codehaus.org/] uses the javax.xml.stream.XMLInputFactory and javax.xml.stream.XMLOutputFactory,  you can control which implementation of this factory should be used.

The Factory is discovered using this algorithm:
1. Use the javax.xml.stream.XMLInputFactory , javax.xml.stream.XMLOutputFactory system property.
2. Use the lib/xml.stream.properties file in the JRE_HOME directory.
3. Use the Services API, if available, to determine the classname by looking in the META-INF/services/javax.xml.stream.XMLInputFactory, META-INF/services/javax.xml.stream.XMLOutputFactory  files in jars available to the JRE.
4. Use the platform default XMLInputFactory,XMLOutputFactory instance.

Dependencies

To use XStream in your camel routes you need to add the a dependency on camel-xstream which implements this data format. 

If you use maven you could just add the following to your pom.xml, substituting the version number for the latest  greatest release (see the download page for the latest versions).


dependency
  groupIdorg.apache.camel/groupId
  artifactIdcamel-xstream/artifactId
  version1.5.0/version
/dependency













Powered by
Atlassian Confluence
(Version: 2.2.9 Build:#527 Sep 07, 2006)
-
Bug/feature request

Unsubscribe or edit your notifications preferences