camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mbhaya <mohit.02...@gmail.com>
Subject Camel JacksonDataFormat configuration in Spring XML
Date Sat, 18 May 2013 17:17:41 GMT
Hi,

I am working on JSON marshalling/unmarshalling and need to exclude certain
POJO fields from marshalling.
I have referred to the following link:
           http://camel.apache.org/json.html

It says that JSON View needs to be used.

And after that we need to specify the following in the java file.

JacksonDataFormat ageViewFormat = new JacksonDataFormat(TestPojoView.class,
Views.Age.class);
from("direct:inPojoAgeView").marshal(ageViewFormat);

I want to specify the above configuration in spring xml file. I know that we
can specify the dataformats in the following way:
 <json id="jack" library="Jackson"
unmarshalTypeName="org.apache.camel.component.jackson.TestPojo"/>
But  I want to configure the JSON view(JacksonDataFormat ageViewFormat = new
JacksonDataFormat(TestPojoView.class, Views.Age.class)) in the spring xml
itself.

Please let me know how to do that.





--
View this message in context: http://camel.465427.n5.nabble.com/Camel-JacksonDataFormat-configuration-in-Spring-XML-tp5732801.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message