svn commit: r1334883 - in /camel/branches/camel-2.8.x: ./ apache-camel/pom.xml components/camel-msv/pom.xml
Author: bvahdat Date: Mon May 7 06:34:38 2012 New Revision: 1334883 URL: http://svn.apache.org/viewvc?rev=1334883&view=rev Log: Merged revisions 1334397 via svnmerge from https://svn.apache.org/repos/asf/camel/branches/camel-2.9.x r1334397 | bvahdat | 2012-05-05 13:01:31 +0200 (Sa, 05 Mai 2012) | 9 lines Merged revisions 1300914 via svnmerge from https://svn.apache.org/repos/asf/camel/trunk r1300914 | bvahdat | 2012-03-15 12:15:06 +0100 (Do, 15 Mär 2012) | 1 line Fixed the failed build because of camel-msv dependencies while using Maven 3.0.4. Modified: camel/branches/camel-2.8.x/ (props changed) camel/branches/camel-2.8.x/apache-camel/pom.xml camel/branches/camel-2.8.x/components/camel-msv/pom.xml Propchange: camel/branches/camel-2.8.x/ -- Merged /camel/trunk:r1300914 Merged /camel/branches/camel-2.9.x:r1334397 Propchange: camel/branches/camel-2.8.x/ -- Binary property 'svnmerge-integrated' - no diff available. Modified: camel/branches/camel-2.8.x/apache-camel/pom.xml URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/apache-camel/pom.xml?rev=1334883&r1=1334882&r2=1334883&view=diff == --- camel/branches/camel-2.8.x/apache-camel/pom.xml (original) +++ camel/branches/camel-2.8.x/apache-camel/pom.xml Mon May 7 06:34:38 2012 @@ -289,13 +289,6 @@ org.apache.camel camel-msv - - - - org.iso_relax.verifier.jaxp.validation - isorelax-jaxp-bridge - - org.apache.camel Modified: camel/branches/camel-2.8.x/components/camel-msv/pom.xml URL: http://svn.apache.org/viewvc/camel/branches/camel-2.8.x/components/camel-msv/pom.xml?rev=1334883&r1=1334882&r2=1334883&view=diff == --- camel/branches/camel-2.8.x/components/camel-msv/pom.xml (original) +++ camel/branches/camel-2.8.x/components/camel-msv/pom.xml Mon May 7 06:34:38 2012 @@ -35,6 +35,27 @@ org.apache.camel.component.validator.msv.* + + + + apache.smx.repo + http://svn.apache.org/repos/asf/servicemix/m2-repo/ + Apache ServiceMix Repo + +false + + +true + + + + org.apache.camel
svn commit: r1334780 - /camel/branches/camel-2.8.x/
Author: dkulp Date: Sun May 6 21:17:35 2012 New Revision: 1334780 URL: http://svn.apache.org/viewvc?rev=1334780&view=rev Log: Fix the svnmerge props Modified: camel/branches/camel-2.8.x/ (props changed) Propchange: camel/branches/camel-2.8.x/ -- Binary property 'svnmerge-integrated' - no diff available.
svn commit: r816016 - in /websites/production/camel/content: book-dataformat-appendix.html book-in-one-page.html cache/main.pageCache json.html
Author: buildbot Date: Sun May 6 13:20:54 2012 New Revision: 816016 Log: Production update by buildbot for camel Modified: websites/production/camel/content/book-dataformat-appendix.html websites/production/camel/content/book-in-one-page.html websites/production/camel/content/cache/main.pageCache websites/production/camel/content/json.html Modified: websites/production/camel/content/book-dataformat-appendix.html == --- websites/production/camel/content/book-dataformat-appendix.html (original) +++ websites/production/camel/content/book-dataformat-appendix.html Sun May 6 13:20:54 2012 @@ -872,9 +872,7 @@ from("seda:peop JSON JSON is a Data Format to marshal and unmarshal Java objects to and from http://www.json.org/"; rel="nofollow">JSON. -In Camel 1.6 its only the XStream library that is supported and its default. - -In Camel 2.0 we added support for more libraries: +Camel supports the following libraries: Camel provides integration with three popular JSON libraries: The http://xstream.codehaus.org/"; rel="nofollow">XStream library and http://jettison.codehaus.org/"; rel="nofollow">Jettsion The http://xircles.codehaus.org/projects/jackson"; rel="nofollow">Jackson libraryCamel 2.10: The http://code.google.com/p/google-gson/"; rel="nofollow">GSon library @@ -1012,7 +1010,7 @@ from("direct:in@@ -1028,7 +1026,7 @@ from("direct:in org.apache.camel camel-xstream -2.0 +2.9.2 @@ -1044,7 +1042,7 @@ from("direct:in org.apache.camel camel-jackson -2.0 +2.9.2 Modified: websites/production/camel/content/book-in-one-page.html == --- websites/production/camel/content/book-in-one-page.html (original) +++ websites/production/camel/content/book-in-one-page.html Sun May 6 13:20:54 2012 @@ -11692,9 +11692,7 @@ from("seda:peop JSON JSON is a Data Format to marshal and unmarshal Java objects to and from http://www.json.org/"; rel="nofollow">JSON. -In Camel 1.6 its only the XStream library that is supported and its default. - -In Camel 2.0 we added support for more libraries: +Camel supports the following libraries: Camel provides integration with three popular JSON libraries: The http://xstream.codehaus.org/"; rel="nofollow">XStream library and http://jettison.codehaus.org/"; rel="nofollow">Jettsion The http://xircles.codehaus.org/projects/jackson"; rel="nofollow">Jackson libraryCamel 2.10: The http://code.google.com/p/google-gson/"; rel="nofollow">GSon library @@ -11832,7 +11830,7 @@ from("direct:in org.apache.camel camel-gson -2.10 +2.10.0 @@ -11848,7 +11846,7 @@ from("direct:in org.apache.camel camel-xstream -2.0 +2.9.2 @@ -11864,7 +11862,7 @@ from("direct:in org.apache.camel camel-jackson -2.0 +2.9.2 Modified: websites/production/camel/content/cache/main.pageCache == Binary files - no diff available. Modified: websites/production/camel/content/json.html == --- websites/production/camel/content/json.html (original) +++ websites/production/camel/content/json.html Sun May 6 13:20:54 2012 @@ -78,9 +78,7 @@ JSON JSON is a Data Format to marshal and unmarshal Java objects to and from http://www.json.org/"; rel="nofollow">JSON. -In Camel 1.6 its only the XStream library that is supported and its default. - -In Camel 2.0 we added support for more libraries: +Camel supports the following libraries: Camel provides integration with three popular JSON libraries: The http://xstream.codehaus.org/"; rel="nofollow">XStream library and http://jettison.codehaus.org/"; rel="nofollow">Jettsion The http://xircles.codehaus.org/projects/jackson"; rel="nofollow">Jackson libraryCamel 2.10: The http://code.google.com/p/google-gson/"; rel="nofollow">GSon library @@ -218,7 +216,7 @@ from("direct:in org.apache.camel camel-gson -2.10 +2.10.0 @@ -234,7 +232,7 @@ from("direct:in org.apache.camel camel-xstream -2.0 +2.9.2
[CONF] Apache Camel > JSON
JSON Page edited by Christian Mueller Changes (5) ... JSON is a [Data Format] to marshal and unmarshal Java objects to and from [JSON|http://www.json.org/]. In Camel 2.0 we added support for more libraries: Camel supports the following libraries: Camel provides integration with three popular JSON libraries: - The [XStream library|http://xstream.codehaus.org/] and [Jettsion |http://jettison.codehaus.org/] ... org.apache.camel camel-xstream 2.0 2.9.2 {code} ... org.apache.camel camel-jackson 2.0 2.9.2 {code} ... org.apache.camel camel-gson 2.10.0 {code} Full Content JSON JSON is a Data Format to marshal and unmarshal Java objects to and from JSON. Camel supports the following libraries: Camel provides integration with three popular JSON libraries: The XStream library and Jettsion The Jackson library Camel 2.10: The GSon library By default Camel uses the XStream library. Using JSON data format with the XStream library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(). to("mqseries:Another.Queue"); Using JSON data format with the Jackson library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(JsonLibrary.Jackson). to("mqseries:Another.Queue"); Using JSON data format with the GSON library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(JsonLibrary.Gson). to("mqseries:Another.Queue"); Using JSON in Spring DSL When using Data Format in Spring DSL you need to declare the data formats first. This is done in the DataFormats XML tag. "jack" library="Jackson" unmarshalTypeName="org.apache.camel.component.jackson.TestPojo"/> And then you can refer to this id in the route: "direct:back"/> "jack"/> "mock:reverse"/> Excluding POJO fields from marshalling As of Camel 2.10 When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. First create one or more marker classes. public class Views { static class Weight { } static class Age { } } Use the marker classes with the @JsonView annotation to include/exclude certain fields. The annotation also works on getters. @JsonView(Views.Age.class) private int age = 30; private int height = 190; @JsonView(Views.Weight.class) private int weight = 70; Finally use the Camel JacksonDataFormat to marshall the above POJO to JSON. JacksonDataFormat ageViewFormat = new JacksonDataFormat(TestPojoView.class, Views.Age.class); from("direct:inPojoAgeView").marshal(ageViewFormat); Note that the weight field is missing in the resulting JSON: {"age":30, "height":190} The GSON library supports a similar feature through the notion of ExclusionStrategies: /** * Strategy to exclude {@link ExcludeAge} annotated fields */ protected static class AgeExclusionStrategy implements ExclusionStrategy { @Override public boolean shouldSkipField(FieldAttributes f) { return f.getAnnotation(ExcludeAge.class) != null; } @Override public boolean shouldSkipClass(Class clazz) { return false; } } The GsonDataFormat accepts an ExclusionStrategy in its constructor: GsonDataFormat ageExclusionFormat = new GsonDataFormat(TestPojoExclusion.class, new AgeExclusionStrategy()); from("direct:inPojoExcludeAge").marshal(ageExclusionFormat); The line above will exclude fields annotated with @ExcludeAge when marshalling to JSON. Dependencies for XStream To use JSON 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). org.apache.camel camel-xstream 2.9.2 Dependencies for Jackson To use JSON in your camel routes you need to add the a dependency on camel-jackson 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). org.apache.camel camel-jackson 2.9.2 Dependencies for GSON To use JSON in your camel routes you need to add the a dependency on camel-gson which implements this data format. If you use maven
[CONF] Apache Camel > JSON
JSON Page edited by Christian Mueller Changes (1) ... JSON is a [Data Format] to marshal and unmarshal Java objects to and from [JSON|http://www.json.org/]. In Camel 1.6 its only the XStream library that is supported and its default. In Camel 2.0 we added support for more libraries: Camel provides integration with three popular JSON libraries: ... Full Content JSON JSON is a Data Format to marshal and unmarshal Java objects to and from JSON. In Camel 2.0 we added support for more libraries: Camel provides integration with three popular JSON libraries: The XStream library and Jettsion The Jackson library Camel 2.10: The GSon library By default Camel uses the XStream library. Using JSON data format with the XStream library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(). to("mqseries:Another.Queue"); Using JSON data format with the Jackson library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(JsonLibrary.Jackson). to("mqseries:Another.Queue"); Using JSON data format with the GSON library // lets turn Object messages into json then send to MQSeries from("activemq:My.Queue"). marshal().json(JsonLibrary.Gson). to("mqseries:Another.Queue"); Using JSON in Spring DSL When using Data Format in Spring DSL you need to declare the data formats first. This is done in the DataFormats XML tag. "jack" library="Jackson" unmarshalTypeName="org.apache.camel.component.jackson.TestPojo"/> And then you can refer to this id in the route: "direct:back"/> "jack"/> "mock:reverse"/> Excluding POJO fields from marshalling As of Camel 2.10 When marshalling a POJO to JSON you might want to exclude certain fields from the JSON output. With Jackson you can use JSON views to accomplish this. First create one or more marker classes. public class Views { static class Weight { } static class Age { } } Use the marker classes with the @JsonView annotation to include/exclude certain fields. The annotation also works on getters. @JsonView(Views.Age.class) private int age = 30; private int height = 190; @JsonView(Views.Weight.class) private int weight = 70; Finally use the Camel JacksonDataFormat to marshall the above POJO to JSON. JacksonDataFormat ageViewFormat = new JacksonDataFormat(TestPojoView.class, Views.Age.class); from("direct:inPojoAgeView").marshal(ageViewFormat); Note that the weight field is missing in the resulting JSON: {"age":30, "height":190} The GSON library supports a similar feature through the notion of ExclusionStrategies: /** * Strategy to exclude {@link ExcludeAge} annotated fields */ protected static class AgeExclusionStrategy implements ExclusionStrategy { @Override public boolean shouldSkipField(FieldAttributes f) { return f.getAnnotation(ExcludeAge.class) != null; } @Override public boolean shouldSkipClass(Class clazz) { return false; } } The GsonDataFormat accepts an ExclusionStrategy in its constructor: GsonDataFormat ageExclusionFormat = new GsonDataFormat(TestPojoExclusion.class, new AgeExclusionStrategy()); from("direct:inPojoExcludeAge").marshal(ageExclusionFormat); The line above will exclude fields annotated with @ExcludeAge when marshalling to JSON. Dependencies for XStream To use JSON 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). org.apache.camel camel-xstream 2.0 Dependencies for Jackson To use JSON in your camel routes you need to add the a dependency on camel-jackson 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). org.apache.camel camel-jackson 2.0 Dependencies for GSON To use JSON in your camel routes you need to add the a dependency on camel-gson 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). org.apache.camel camel-gson 2.10 Change Notification Preferences View Online | View Changes | Add Co