tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1244154 - /tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java
Date Tue, 14 Feb 2012 18:39:24 GMT
Author: rfeng
Date: Tue Feb 14 18:39:23 2012
New Revision: 1244154

URL: http://svn.apache.org/viewvc?rev=1244154&view=rev
Log:
Make the jackson annotation introspector come before the JAXB one as we need to use the Jackson
annotations to override the JAXB in some cases

Modified:
    tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java

Modified: tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java?rev=1244154&r1=1244153&r2=1244154&view=diff
==============================================================================
--- tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java
(original)
+++ tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java
Tue Feb 14 18:39:23 2012
@@ -104,8 +104,9 @@ public class JacksonHelper {
             mapper = new ObjectMapper();
             mapper.registerModule(new JsonOrgModule());
         }
-        AnnotationIntrospector primary = new JaxbAnnotationIntrospector();
-        AnnotationIntrospector secondary = new JacksonAnnotationIntrospector();
+        // Let's honor the Jackson annotations first
+        AnnotationIntrospector primary = new JacksonAnnotationIntrospector();
+        AnnotationIntrospector secondary = new JaxbAnnotationIntrospector();
         AnnotationIntrospector pair = new AnnotationIntrospector.Pair(primary, secondary);
         mapper.setDeserializationConfig(mapper.getDeserializationConfig().withAnnotationIntrospector(pair)
             .without(DeserializationConfig.Feature.FAIL_ON_UNKNOWN_PROPERTIES)



Mime
View raw message