cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1104151 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/
Date Tue, 17 May 2011 11:16:21 GMT
Author: sergeyb
Date: Tue May 17 11:16:20 2011
New Revision: 1104151

URL: http://svn.apache.org/viewvc?rev=1104151&view=rev
Log:
Merged revisions 1104144 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1104144 | sergeyb | 2011-05-17 12:13:30 +0100 (Tue, 17 May 2011) | 1 line
  
  [CXF-3483] JSONProvider can not convert attributes to elements when explicit collections
are used
........

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisJSONProvider.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProvider.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue May 17 11:16:20 2011
@@ -1 +1 @@
-/cxf/trunk:1099767,1100898,1101399,1102198,1103904
+/cxf/trunk:1099767,1100898,1101399,1102198,1103904,1104144

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisJSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisJSONProvider.java?rev=1104151&r1=1104150&r2=1104151&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisJSONProvider.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/AegisJSONProvider.java
Tue May 17 11:16:20 2011
@@ -127,7 +127,8 @@ public final class AegisJSONProvider<T> 
     protected XMLStreamWriter createStreamWriter(QName typeQName, OutputStream os) throws
Exception {
         
         Configuration config = 
-            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces,
null);
+            JSONUtils.createConfiguration(namespaceMap, 
+                                          writeXsiType && !ignoreNamespaces, false,
null);
         XMLStreamWriter writer = JSONUtils.createStreamWriter(os, typeQName, 
              writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys,
dropRootElement);
         return JSONUtils.createIgnoreNsWriterIfNeeded(writer, ignoreNamespaces);

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProvider.java?rev=1104151&r1=1104150&r2=1104151&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProvider.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/DataBindingJSONProvider.java
Tue May 17 11:16:20 2011
@@ -95,7 +95,8 @@ public class DataBindingJSONProvider<T> 
             qname = getQName(InjectionUtils.getActualType(genericType));
         }
         Configuration config = 
-            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces,
null);
+            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces,
+                                          false, null);
         XMLStreamWriter writer = JSONUtils.createStreamWriter(os, qname, 
              writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys,
dropRootElement);
         writer = JSONUtils.createIgnoreMixedContentWriterIfNeeded(writer, ignoreMixedContent);

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java?rev=1104151&r1=1104150&r2=1104151&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONProvider.java
Tue May 17 11:16:20 2011
@@ -85,6 +85,12 @@ public class JSONProvider extends Abstra
     private boolean ignoreNamespaces;
     private String convention = MAPPED_CONVENTION;
     private TypeConverter typeConverter;
+    private boolean attributesToElements;
+    
+    @Override
+    public void setAttributesToElements(boolean value) {
+        this.attributesToElements = value;
+    }
     
     public void setConvention(String value) {
         if (!MAPPED_CONVENTION.equals(value) && !BADGER_FISH_CONVENTION.equals(value))
{
@@ -398,7 +404,10 @@ public class JSONProvider extends Abstra
         QName qname = getQName(actualClass, genericType, actualObject, true);
         
         Configuration config = 
-            JSONUtils.createConfiguration(namespaceMap, writeXsiType && !ignoreNamespaces,
typeConverter);
+            JSONUtils.createConfiguration(namespaceMap, 
+                                          writeXsiType && !ignoreNamespaces,
+                                          attributesToElements,
+                                          typeConverter);
         
         XMLStreamWriter writer = JSONUtils.createStreamWriter(os, qname, 
              writeXsiType && !ignoreNamespaces, config, serializeAsArray, arrayKeys,

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java?rev=1104151&r1=1104150&r2=1104151&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/JSONUtils.java
Tue May 17 11:16:20 2011
@@ -100,11 +100,13 @@ public final class JSONUtils {
     
     public static Configuration createConfiguration(ConcurrentHashMap<String, String>
namespaceMap,
                                                     boolean writeXsiType,
+                                                    boolean attributesAsElements,
                                                     TypeConverter converter) {
         if (writeXsiType) {
             namespaceMap.putIfAbsent(XSI_URI, XSI_PREFIX);
         }
         Configuration c = new Configuration(namespaceMap);
+        c.setSupressAtAttributes(attributesAsElements);
         if (converter != null) {
             c.setTypeConverter(converter);
         }



Mime
View raw message