cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r785303 - in /cxf/branches/2.1.x-fixes: ./ api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
Date Tue, 16 Jun 2009 17:13:55 GMT
Author: dkulp
Date: Tue Jun 16 17:13:55 2009
New Revision: 785303

URL: http://svn.apache.org/viewvc?rev=785303&view=rev
Log:
Merged revisions 784197 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.2.x-fixes

................
  r784197 | dkulp | 2009-06-12 13:07:01 -0400 (Fri, 12 Jun 2009) | 11 lines
  
  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.1.x-fixes/   (props changed)
    cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java

Propchange: cxf/branches/2.1.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Jun 16 17:13:55 2009
@@ -1,2 +1,2 @@
-/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064
-/cxf/trunk:782181,782728-782730,783097,783396,784059
+/cxf/branches/2.2.x-fixes:743446,753380,753397,753421,754585,755365,757499,757859,757899,757935,757951,758195,758303,758308,758378,758690,758910,759890,759961,759963-759964,759966,760029,760073,760150,760171,760178,760198,760212,760456,760468,760582,760938,761094,761113,761120,761317,761759,761789,762393,762518,762567,763200,763272,763495,763854,763931,763942,763953,764033-764034,764581,764599-764606,764887,765357,766013,766058,766100-766101,766763,766770,766860,766962-766963,767159,767191,767927,771416,772143,772402,772658,772714,773009-773010,773027,773049,773146,773581,773691,773693,774446-774496,774558,774760,774851,774979,775423,776024-776025,776218,776429,776459,777189,777224,777243,777481,777505,777572,777580,780033,780184,780213,780421,780664,780800,780902,780911,781497,781841,782733,782735-782736,783099,783407,784064,784197
+/cxf/trunk:782181,782728-782730,783097,783396,784059,784181

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

Modified: cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java?rev=785303&r1=785302&r2=785303&view=diff
==============================================================================
--- cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
(original)
+++ cxf/branches/2.1.x-fixes/api/src/main/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertion.java
Tue Jun 16 17:13:55 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