cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r784197 - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
Date Fri, 12 Jun 2009 17:07:01 GMT
Author: dkulp
Date: Fri Jun 12 17:07:01 2009
New Revision: 784197

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

........
  r784181 | dkulp | 2009-06-12 12:25:29 -0400 (Fri, 12 Jun 2009) | 3 lines
  
  [CXF-2278]  Implement serialize method on JaxbAssertions
  Patch from   Dominic Harries applied
  From University of Southampton IT Innovation Centre
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jun 12 17:07:01 2009
@@ -1 +1 @@
-/cxf/trunk:782728-782730,783097,783294,783396,784059
+/cxf/trunk:782728-782730,783097,783294,783396,784059,784181

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Jun 12 17:07:01 2009
@@ -1 +1 @@
-/cxf/trunk:1-782619,782728-782730,783097,783294,783396,784059
+/cxf/trunk:1-782619,782728-782730,783097,783294,783396,784059,784181

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java?rev=784197&r1=784196&r2=784197&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
(original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
Fri Jun 12 17:07:01 2009
@@ -19,8 +19,14 @@
 
 package org.apache.cxf.ws.policy.builder.jaxb;
 
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBException;
+import javax.xml.bind.Marshaller;
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamWriter;
 
+import org.apache.cxf.common.util.PackageUtils;
 import org.apache.cxf.ws.policy.PolicyAssertion;
 import org.apache.cxf.ws.policy.builder.primitive.PrimitiveAssertion;
 import org.apache.neethi.PolicyComponent;
@@ -74,4 +80,17 @@
         return (JaxbAssertion<T>)a;
     }
 
+    @Override
+    public void serialize(XMLStreamWriter writer) throws XMLStreamException {
+        try {
+            JAXBContext context = JAXBContext.newInstance(PackageUtils.getPackageName(data.getClass()),
+                                                          data.getClass().getClassLoader());
+            Marshaller marshaller = context.createMarshaller();
+            marshaller.setProperty("jaxb.fragment", Boolean.TRUE);
+            marshaller.marshal(data, writer);
+        } catch (JAXBException ex) {
+            throw new RuntimeException(ex);
+        }
+    }
+
 }



Mime
View raw message