camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricke...@apache.org
Subject svn commit: r1308217 - /camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
Date Sun, 01 Apr 2012 23:14:55 GMT
Author: rickette
Date: Sun Apr  1 23:14:55 2012
New Revision: 1308217

URL: http://svn.apache.org/viewvc?rev=1308217&view=rev
Log:
CAMEL-5135: polishing

Modified:
    camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java

Modified: camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java?rev=1308217&r1=1308216&r2=1308217&view=diff
==============================================================================
--- camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
(original)
+++ camel/trunk/components/camel-gson/src/main/java/org/apache/camel/component/gson/GsonDataFormat.java
Sun Apr  1 23:14:55 2012
@@ -59,10 +59,10 @@ public class GsonDataFormat implements D
      * unmarshal type and {@link ExclusionStrategy}
      *
      * @param unmarshalType the custom unmarshal type
-     * @param exclusionStrategy the custom ExclusionStrategy
+     * @param exclusionStrategies one or more custom ExclusionStrategy implementations
      */
-    public GsonDataFormat(Class<?> unmarshalType, ExclusionStrategy exclusionStrategy)
{
-        this(createGsonWithExclusionStrategy(exclusionStrategy), unmarshalType);
+    public GsonDataFormat(Class<?> unmarshalType, ExclusionStrategy... exclusionStrategies)
{
+        this(createGsonWithExclusionStrategy(exclusionStrategies), unmarshalType);
     }
 
     /**
@@ -76,12 +76,8 @@ public class GsonDataFormat implements D
         this.unmarshalType = unmarshalType;
     }
 
-    private static Gson createGsonWithExclusionStrategy(ExclusionStrategy exclusionStrategy)
{
-        if (exclusionStrategy != null) {
-            return new GsonBuilder().setExclusionStrategies(exclusionStrategy).create();
-        } else {
-            return new Gson();
-        }
+    private static Gson createGsonWithExclusionStrategy(ExclusionStrategy... exclusionStrategies)
{
+        return exclusionStrategies != null ? new GsonBuilder().setExclusionStrategies(exclusionStrategies).create()
: new Gson();
     }
 
     @Override



Mime
View raw message