You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2016/05/04 00:48:10 UTC

svn commit: r1742203 - in /webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om: OMDataSource.java OMDataSourceExt.java

Author: veithen
Date: Tue May  3 22:48:10 2016
New Revision: 1742203

URL: http://svn.apache.org/viewvc?rev=1742203&view=rev
Log:
Deprecate methods in OMDataSource and OMDataSourceExt that serialize to streams. They are no longer used by Axiom, have ill defined semantics and are tricky to implement correctly. In particular it is not clear how these methods should handle the following cases:
* Encodings that use a BOM.
* OMOutputFormat specifying XOP/MTOM as output format, and more generally handling of optimized binary data.
* Serialization to documents with an existing namespace.

Modified:
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
    webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java?rev=1742203&r1=1742202&r2=1742203&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java (original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java Tue May  3 22:48:10 2016
@@ -29,6 +29,8 @@ import javax.xml.stream.XMLStreamWriter;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerWriter;
+import org.apache.axiom.om.ds.AbstractOMDataSource;
+import org.apache.axiom.om.ds.AbstractPullOMDataSource;
 import org.apache.axiom.om.ds.AbstractPushOMDataSource;
 import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
 import org.apache.axiom.util.stax.XMLStreamWriterUtils;
@@ -40,6 +42,9 @@ import java.io.Writer;
 /**
  * Interface to arbitrary source of XML element data. This provides the hook for using a general
  * data source (such as data binding frameworks) as the backing source of data for an element.
+ * This interface should not be implemented directly; instead create a subclass of
+ * {@link AbstractOMDataSource}, {@link AbstractPullOMDataSource} or
+ * {@link AbstractPushOMDataSource}.
  */
 public interface OMDataSource {
     /**
@@ -56,6 +61,8 @@ public interface OMDataSource {
      *            the correct character set encoding when writing to the output stream. This
      *            parameter must not be null.
      * @throws XMLStreamException
+     * 
+     * @deprecated
      */
     void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException;
 
@@ -72,6 +79,8 @@ public interface OMDataSource {
      *            output format information (<code>null</code> if none; may be ignored if not
      *            supported by data binding even if supplied)
      * @throws XMLStreamException
+     * 
+     * @deprecated
      */
     void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException;
 

Modified: webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java?rev=1742203&r1=1742202&r2=1742203&view=diff
==============================================================================
--- webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java (original)
+++ webservices/axiom/trunk/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java Tue May  3 22:48:10 2016
@@ -72,6 +72,8 @@ public interface OMDataSourceExt extends
      * Returns a InputStream representing the xml data
      * @param encoding String encoding of InputStream
      * @return InputStream
+     * 
+     * @deprecated
      */
     InputStream getXMLInputStream(String encoding) throws UnsupportedEncodingException;
     
@@ -80,6 +82,8 @@ public interface OMDataSourceExt extends
      * @param encoding String encoding of InputStream
      * @return byte[]
      * @see #getXMLInputStream(String)
+     * 
+     * @deprecated
      */
     byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException;