ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1335668 - in /webservices/axiom/branches/AXIOM-420: ./ modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java
Date Tue, 08 May 2012 18:08:35 GMT
Author: veithen
Date: Tue May  8 18:08:34 2012
New Revision: 1335668

URL: http://svn.apache.org/viewvc?rev=1335668&view=rev
Log:
Merged latest changes from trunk.

Modified:
    webservices/axiom/branches/AXIOM-420/   (props changed)
    webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
    webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java

Propchange: webservices/axiom/branches/AXIOM-420/
------------------------------------------------------------------------------
  Merged /webservices/commons/trunk/modules/axiom:r1335170-1335667

Modified: webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java?rev=1335668&r1=1335667&r2=1335668&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
(original)
+++ webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSource.java
Tue May  8 18:08:34 2012
@@ -35,41 +35,59 @@ import java.io.Writer;
 public interface OMDataSource {
     /**
      * Serializes element data directly to stream.
-     *
-     * @param output destination stream for element XML text
-     * @param format Output format information. The implementation must use this information
-     *               to choose the correct character set encoding when writing to the
-     *               output stream. This parameter must not be null.
+     * <p>
+     * It is assumed that this method consumed the content (i.e. destroys the backing object)
unless
+     * the data source also implements {@link OMDataSourceExt} and
+     * {@link OMDataSourceExt#isDestructiveWrite()} returns <code>false</code>.
+     * 
+     * @param output
+     *            destination stream for element XML text
+     * @param format
+     *            Output format information. The implementation must use this information
to choose
+     *            the correct character set encoding when writing to the output stream. This
+     *            parameter must not be null.
      * @throws XMLStreamException
      */
-    void serialize(OutputStream output, OMOutputFormat format)
-            throws XMLStreamException;
+    void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException;
 
     /**
      * Serializes element data directly to writer.
-     *
-     * @param writer destination writer for element XML text
-     * @param format output format information (<code>null</code> if none; may
be ignored if not
-     *               supported by data binding even if supplied)
+     * <p>
+     * It is assumed that this method consumed the content (i.e. destroys the backing object)
unless
+     * the data source also implements {@link OMDataSourceExt} and
+     * {@link OMDataSourceExt#isDestructiveWrite()} returns <code>false</code>.
+     * 
+     * @param writer
+     *            destination writer for element XML text
+     * @param format
+     *            output format information (<code>null</code> if none; may be
ignored if not
+     *            supported by data binding even if supplied)
      * @throws XMLStreamException
      */
-    void serialize(Writer writer, OMOutputFormat format)
-            throws XMLStreamException;
+    void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException;
 
     /**
      * Serializes element data directly to StAX writer.
-     *
-     * @param xmlWriter destination writer
+     * <p>
+     * It is assumed that this method consumed the content (i.e. destroys the backing object)
unless
+     * the data source also implements {@link OMDataSourceExt} and
+     * {@link OMDataSourceExt#isDestructiveWrite()} returns <code>false</code>.
+     * 
+     * @param xmlWriter
+     *            destination writer
      * @throws XMLStreamException
      */
     // TODO: specify whether the implementation MUST, MAY or MUST NOT write START_DOCUMENT
and END_DOCUMENT events to the stream
-    void serialize(XMLStreamWriter xmlWriter)
-            throws XMLStreamException;
+    void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException;
 
     /**
      * Get parser for element data. In the general case this may require the data source
to
      * serialize data as XML text and then parse that text.
-     *
+     * <p>
+     * It is assumed that this method consumed the content (i.e. destroys the backing object)
unless
+     * the data source also implements {@link OMDataSourceExt} and
+     * {@link OMDataSourceExt#isDestructiveRead()} returns <code>false</code>.
+     * 
      * @return element parser
      * @throws XMLStreamException
      */

Modified: webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java?rev=1335668&r1=1335667&r2=1335668&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java
(original)
+++ webservices/axiom/branches/AXIOM-420/modules/axiom-api/src/main/java/org/apache/axiom/om/OMDataSourceExt.java
Tue May  8 18:08:34 2012
@@ -18,14 +18,8 @@
  */
 package org.apache.axiom.om;
 
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLStreamWriter;
-
 import java.io.InputStream;
-import java.io.OutputStream;
 import java.io.UnsupportedEncodingException;
-import java.io.Writer;
 
 /**
  * Interface to a backing object that can can be read and written as XML.
@@ -49,51 +43,7 @@ public interface OMDataSourceExt extends
      * If Boolean.TRUE, this indicates that expansion is needed to 
      * obtain the actual prefix name. 
      */
-    public static final String LOSSY_PREFIX = "lossyPrefix";
-
-    /**
-     * Serializes element data directly to stream.
-     * Assumes that the backing object is destroyed during serialization if isDestructiveWrite
-     * @see OMDataSourceExt
-     *
-     * @param output destination stream for element XML text
-     * @param format Output format information. The implementation must use this information
-     *               to choose the correct character set encoding when writing to the
-     *               output stream. This parameter must not be null.
-     * @throws XMLStreamException
-     */
-    public void serialize(OutputStream output, OMOutputFormat format) throws XMLStreamException;
-
-    /**
-     * Serializes element data directly to writer.
-     * Assumes that the backing object is destroyed during serialization isDestructiveWrite
-     * @see OMDataSourceExt
-     *
-     * @param writer destination writer for element XML text
-     * @param format output format information (<code>null</code> if none; may
-     * be ignored if not supported by data binding even if supplied)
-     * @throws XMLStreamException
-     */
-    public void serialize(Writer writer, OMOutputFormat format) throws XMLStreamException;
-
-    /**
-     * Serializes element data directly to StAX writer.
-     * Assumes that the backing object is destroyed during serialization isDestructiveWrite
-     * @see OMDataSourceExt
-     *
-     * @param xmlWriter destination writer
-     * @throws XMLStreamException
-     */
-    public void serialize(XMLStreamWriter xmlWriter) throws XMLStreamException;
-
-    /**
-     * Get parser for element data. In the general case this may require the
-     * data source to serialize data as XML text and then parse that text.
-     *
-     * @return element parser
-     * @throws XMLStreamException
-     */
-    public XMLStreamReader getReader() throws XMLStreamException;
+    String LOSSY_PREFIX = "lossyPrefix";
     
     /**
      * Get the object that backs this data source. Application code should in general not
call this
@@ -106,7 +56,7 @@ public interface OMDataSourceExt extends
      * @return the backing object, or <code>null</code> if the data source has
no backing object or
      *         if the backing object can't be accessed in a safe way
      */
-    public Object getObject();
+    Object getObject();
     
     /**
      * Returns true if reading the backing object is destructive.
@@ -115,7 +65,7 @@ public interface OMDataSourceExt extends
      * expansion is needed when reading the OMDataSourceExt.
      * @return boolean
      */
-    public boolean isDestructiveRead();
+    boolean isDestructiveRead();
     
     /**
      * Returns true if writing the backing object is destructive.
@@ -124,14 +74,14 @@ public interface OMDataSourceExt extends
      * expansion is needed when writing the OMDataSourceExt.
      * @return boolean
      */
-    public boolean isDestructiveWrite();
+    boolean isDestructiveWrite();
     
     /**
      * Returns a InputStream representing the xml data
      * @param encoding String encoding of InputStream
      * @return InputStream
      */
-    public InputStream getXMLInputStream(String encoding) throws UnsupportedEncodingException;
+    InputStream getXMLInputStream(String encoding) throws UnsupportedEncodingException;
     
     /**
      * Returns a byte[] representing the xml data
@@ -139,32 +89,32 @@ public interface OMDataSourceExt extends
      * @return byte[]
      * @see #getXMLInputStream(String)
      */
-    public byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException;
+    byte[] getXMLBytes(String encoding) throws UnsupportedEncodingException;
     
     /**
      * Close the DataSource and free its resources.
      */
-    public void close();
+    void close();
     
     /**
      * Create a copy of the OMDataSourceExt
      * @return OMDataSourceExt
      */
-    public OMDataSourceExt copy();
+    OMDataSourceExt copy();
     
     /**
      * Returns true if property is set
      * @param key
      * @return TODO
      */
-    public boolean hasProperty(String key);
+    boolean hasProperty(String key);
     
     /**
      * Query a property stored on the OMDataSource
      * @param key
      * @return value or null
      */
-    public Object getProperty(String key);
+    Object getProperty(String key);
     
     /**
      * Set a property on the OMDataSource
@@ -172,5 +122,5 @@ public interface OMDataSourceExt extends
      * @param value
      * @return old property object or null
      */
-    public Object setProperty(String key, Object value);
+    Object setProperty(String key, Object value);
 }



Mime
View raw message