tuscany-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rf...@apache.org
Subject svn commit: r1383130 - /tuscany/sca-java-2.x/trunk/modules/databinding-json/src/main/java/org/apache/tuscany/sca/databinding/json/jackson/JacksonHelper.java
Date Mon, 10 Sep 2012 22:15:06 GMT
Author: rfeng
Date: Mon Sep 10 22:15:06 2012
New Revision: 1383130

URL: http://svn.apache.org/viewvc?rev=1383130&view=rev
Log:
Fix the default mapper so that it can handle tuscanyFilter

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=1383130&r1=1383129&r2=1383130&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
Mon Sep 10 22:15:06 2012
@@ -62,9 +62,10 @@ import com.fasterxml.jackson.module.json
  * 
  */
 public class JacksonHelper {
+    private final static SimpleBeanPropertyFilter DEFAULT_FILTER = SimpleBeanPropertyFilter.serializeAllExcept();
     public final static ObjectMapper MAPPER = createMapper();
     private final static JsonFactory FACTORY = new MappingJsonFactory(createMapper());
-
+    
     public static ObjectMapper createMapper() {
         return createObjectMapper(null);
     }
@@ -132,6 +133,7 @@ public class JacksonHelper {
             .withSerializationInclusion(JsonSerialize.Inclusion.NON_NULL)
             .withDateFormat(StdDateFormat.getBlueprintISO8601Format()));
 
+        mapper.setFilters(new SimpleFilterProvider().addFilter("tuscanyFilter", DEFAULT_FILTER));
         return mapper;
     }
 
@@ -244,8 +246,7 @@ public class JacksonHelper {
             throw new IOException(e);
         }
     }
-
-    private final static SimpleBeanPropertyFilter DEFAULT_FILTER = SimpleBeanPropertyFilter.serializeAllExcept();
+    
 
     public static FilterProvider configureFilterProvider(TransformationContext context) {
         SimpleBeanPropertyFilter filter = DEFAULT_FILTER;
@@ -260,5 +261,6 @@ public class JacksonHelper {
         }
         FilterProvider filters = new SimpleFilterProvider().addFilter("tuscanyFilter", filter);
         return filters;
-    }
+    }    
+
 }



Mime
View raw message