incubator-wink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lrese...@apache.org
Subject svn commit: r1401345 - /incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java
Date Tue, 23 Oct 2012 16:36:21 GMT
Author: lresende
Date: Tue Oct 23 16:36:21 2012
New Revision: 1401345

URL: http://svn.apache.org/viewvc?rev=1401345&view=rev
Log:
Removing deprecated code from Jackson integration

Modified:
    incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java

Modified: incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java
URL: http://svn.apache.org/viewvc/incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java?rev=1401345&r1=1401344&r2=1401345&view=diff
==============================================================================
--- incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java
(original)
+++ incubator/wink/trunk/wink-providers/wink-jackson-provider/src/main/java/org/apache/wink/providers/jackson/WinkJacksonJaxbJsonProvider.java
Tue Oct 23 16:36:21 2012
@@ -28,8 +28,10 @@ import javax.ws.rs.ext.Provider;
 
 import org.codehaus.jackson.jaxrs.JacksonJaxbJsonProvider;
 import org.codehaus.jackson.map.AnnotationIntrospector;
+import org.codehaus.jackson.map.DeserializationConfig;
 import org.codehaus.jackson.map.DeserializationConfig.Feature;
 import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.map.SerializationConfig;
 import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
 import org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector;
 import org.codehaus.jackson.xc.JaxbAnnotationIntrospector;
@@ -45,15 +47,22 @@ public class WinkJacksonJaxbJsonProvider
 
     private static ObjectMapper createObjectMapper() {
         ObjectMapper mapper = new ObjectMapper();
-        mapper.getSerializationConfig().setSerializationInclusion(Inclusion.NON_NULL);
-        mapper.getDeserializationConfig().set(Feature.FAIL_ON_UNKNOWN_PROPERTIES, Boolean.FALSE);
-//        mapper.getSerializationConfig().setDateFormat(StdDateFormat.getBlueprintISO8601Format());
-//        mapper.getDeserializationConfig().setDateFormat(StdDateFormat.getBlueprintISO8601Format());
+
         AnnotationIntrospector pair =
             new AnnotationIntrospector.Pair(new JaxbAnnotationIntrospector(),
                                             new JacksonAnnotationIntrospector());
-        mapper.getDeserializationConfig().setAnnotationIntrospector(pair);
-        mapper.getSerializationConfig().setAnnotationIntrospector(pair);
+
+        SerializationConfig serializationConfig = 
+            mapper.getSerializationConfig().withSerializationInclusion(Inclusion.NON_NULL).withAnnotationIntrospector(pair);
+           //.withDateFormat(StdDateFormat.getBlueprintISO8601Format());
+
+
+        DeserializationConfig deserializationConfig = 
+            mapper.getDeserializationConfig().without(Feature.FAIL_ON_UNKNOWN_PROPERTIES).withAnnotationIntrospector(pair);
+            //.withDateFormat(StdDateFormat.getBlueprintISO8601Format());
+
+        mapper.setSerializationConfig(serializationConfig);
+        mapper.setDeserializationConfig(deserializationConfig);
         return mapper;
     }
 



Mime
View raw message