From 5dd2ce8d6ab5905fb4b4366d1063c6161f91c261 Mon Sep 17 00:00:00 2001 From: rfeng Date: Wed, 15 Oct 2008 16:06:49 +0000 Subject: Update to axiom 1.2.7 OMDataSourceExt git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@704946 13f79535-47bb-0310-9956-ffa450edef68 --- .../databinding/jaxb/axiom/ext/JAXBCustomBuilder.java | 18 +++++++++++------- .../sca/databinding/jaxb/axiom/ext/JAXBDSContext.java | 6 +++--- .../databinding/jaxb/axiom/ext/JAXBDataSourceExt.java | 15 ++++++--------- .../databinding/jaxb/axiom/ext/SourceDataSource.java | 14 ++++++-------- .../jaxb/axiom/ext/XMLStringDataSource.java | 16 ++++++---------- 5 files changed, 32 insertions(+), 37 deletions(-) (limited to 'branches/sca-equinox/modules/databinding-jaxb-axiom/src') diff --git a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java index b7a395a623..f30a6c1cb8 100644 --- a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java +++ b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBCustomBuilder.java @@ -19,15 +19,22 @@ package org.apache.tuscany.sca.databinding.jaxb.axiom.ext; +import javax.xml.bind.JAXBException; +import javax.xml.stream.XMLStreamReader; + +import org.apache.axiom.om.OMContainer; +import org.apache.axiom.om.OMDataSource; +import org.apache.axiom.om.OMElement; +import org.apache.axiom.om.OMException; +import org.apache.axiom.om.OMFactory; +import org.apache.axiom.om.OMNamespace; +import org.apache.axiom.om.impl.builder.CustomBuilder; /** * JAXBCustomBuilder creates an OMSourcedElement backed by a JAXBDataSource * for the specified namespace and localPart. */ -public class JAXBCustomBuilder -//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 -// implements CustomBuilder -{ +public class JAXBCustomBuilder implements CustomBuilder { private JAXBDSContext jdsContext; @@ -40,8 +47,6 @@ public class JAXBCustomBuilder this.jdsContext = context; } - // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 - /* public OMElement create(String namespace, String localPart, OMContainer parent, @@ -71,7 +76,6 @@ public class JAXBCustomBuilder throw new OMException(e); } } - */ /** * The namespace identifier for the SOAP 1.1 envelope. diff --git a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java index 6fd65d4752..28997cd244 100644 --- a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java +++ b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDSContext.java @@ -117,9 +117,9 @@ public class JAXBDSContext { * @param writer XMLStreamWriter */ private static void marshalElement(final Object b, - final Marshaller m, - final XMLStreamWriter writer, - final boolean optimize) { + final Marshaller m, + final XMLStreamWriter writer, + final boolean optimize) { AccessController.doPrivileged(new PrivilegedAction() { public Object run() { // Marshalling directly to the output stream is faster than marshalling through the diff --git a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java index 7702d099b4..5a5afc13cb 100644 --- a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java +++ b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/JAXBDataSourceExt.java @@ -33,19 +33,17 @@ import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; import javax.xml.stream.XMLStreamWriter; +import org.apache.axiom.om.OMDataSourceExt; import org.apache.axiom.om.OMException; import org.apache.axiom.om.OMOutputFormat; +import org.apache.axiom.om.ds.OMDataSourceExtBase; import org.apache.axiom.om.impl.MTOMXMLStreamWriter; import org.apache.axiom.om.util.StAXUtils; /** * OMDataSource backed by a jaxb object */ -public class JAXBDataSourceExt - -//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 -// extends OMDataSourceExtBase -{ +public class JAXBDataSourceExt extends OMDataSourceExtBase { private static final Logger log = Logger.getLogger(JAXBDataSourceExt.class.getName()); @@ -61,10 +59,9 @@ public class JAXBDataSourceExt public void close() { } - // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 - // public OMDataSourceExt copy() { - // return new JAXBDataSourceExt(jaxb, context); - // } + public OMDataSourceExt copy() { + return new JAXBDataSourceExt(jaxb, context); + } public Object getObject() { return jaxb; diff --git a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java index 758a82f72f..0a12654524 100644 --- a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java +++ b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/SourceDataSource.java @@ -34,16 +34,15 @@ import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; +import org.apache.axiom.om.OMDataSourceExt; import org.apache.axiom.om.OMException; +import org.apache.axiom.om.ds.OMDataSourceExtBase; import org.apache.axiom.om.util.StAXUtils; /** * OMDataSource backed by a source */ -public class SourceDataSource -// FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 -// extends OMDataSourceExtBase -{ +public class SourceDataSource extends OMDataSourceExtBase { private Source data; public SourceDataSource(Source data) { @@ -54,10 +53,9 @@ public class SourceDataSource public void close() { } - // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 - // public OMDataSourceExt copy() { - // return new SourceDataSource(data); - // } + public OMDataSourceExt copy() { + return new SourceDataSource(data); + } public Object getObject() { return data; diff --git a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java index a2a68c8eb0..e8e3193e24 100644 --- a/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java +++ b/branches/sca-equinox/modules/databinding-jaxb-axiom/src/main/java/org/apache/tuscany/sca/databinding/jaxb/axiom/ext/XMLStringDataSource.java @@ -27,18 +27,15 @@ import java.io.Writer; import javax.xml.stream.XMLStreamException; import javax.xml.stream.XMLStreamReader; +import org.apache.axiom.om.OMDataSourceExt; import org.apache.axiom.om.OMOutputFormat; +import org.apache.axiom.om.ds.OMDataSourceExtBase; import org.apache.axiom.om.util.StAXUtils; /** * OMDataSource backed by a string containing xml data */ -// FIXME: To be refectored into databinding-axiom -public class XMLStringDataSource - -//FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 -// extends OMDataSourceExtBase -{ +public class XMLStringDataSource extends OMDataSourceExtBase { private String data; public XMLStringDataSource(String data) { @@ -49,10 +46,9 @@ public class XMLStringDataSource public void close() { } - // FIXME: [rfeng] Re-enable it after we move to AXIOM 1.2.7 - // public OMDataSourceExt copy() { - // return new XMLStringDataSource(data); - // } + public OMDataSourceExt copy() { + return new XMLStringDataSource(data); + } public Object getObject() { return data; -- cgit v1.2.3