cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject git commit: [CXF-5479] Support XmlType beans by default
Date Wed, 11 Jun 2014 10:48:34 GMT
Repository: cxf
Updated Branches:
  refs/heads/master e3a2b0323 -> 293220128


[CXF-5479] Support XmlType beans by default


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/29322012
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/29322012
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/29322012

Branch: refs/heads/master
Commit: 2932201285b61c4e267a906485000c00f2edb1ee
Parents: e3a2b03
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Wed Jun 11 11:48:16 2014 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Wed Jun 11 11:48:16 2014 +0100

----------------------------------------------------------------------
 .../src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/29322012/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
index 67e3634..ff1ff3c 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java
@@ -623,7 +623,10 @@ public final class ResourceUtils {
         
         MessageBodyWriter<?> writer = jaxbWriter;
         if (writer == null) {
-            writer = new JAXBElementProvider<Object>();
+            JAXBElementProvider<Object> defaultWriter = new JAXBElementProvider<Object>();
+            defaultWriter.setMarshallAsJaxbElement(true);
+            defaultWriter.setXmlTypeAsJaxbElementOnly(true);
+            writer = defaultWriter;
         }
         if (writer.isWriteable(type, type, anns, MediaType.APPLICATION_XML_TYPE)) {
             types.getAllTypes().put(type, type);


Mime
View raw message