ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r793246 - in /webservices/commons/trunk/modules/axiom/modules: axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/ axiom-api/src/main/java/org/apache/axiom/om/impl/ axiom-api/src/main/java/org/apache/axiom/om/impl/builder/ axiom-...
Date Sat, 11 Jul 2009 23:58:35 GMT
Author: veithen
Date: Sat Jul 11 23:58:35 2009
New Revision: 793246

URL: http://svn.apache.org/viewvc?rev=793246&view=rev
Log:
Define the exceptions that can be thrown by the DataHandlerReader extension.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerProvider.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerReader.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/DataHandlerReaderUtil.java
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerProvider.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerProvider.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerProvider.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerProvider.java
Sat Jul 11 23:58:35 2009
@@ -20,6 +20,7 @@
 package org.apache.axiom.ext.stax.datahandler;
 
 import javax.activation.DataHandler;
+import javax.xml.stream.XMLStreamException;
 
 /**
  * Interface used for deferred loading of binary content.
@@ -32,6 +33,8 @@
      * Get the {@link DataHandler} object for the binary content.
      * 
      * @return the binary content
+     * 
+     * @throws XMLStreamException if an error occurs while loading the {@link DataHandler}
      */
-    DataHandler getDataHandler();
+    DataHandler getDataHandler() throws XMLStreamException;
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerReader.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerReader.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerReader.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/datahandler/DataHandlerReader.java
Sat Jul 11 23:58:35 2009
@@ -20,6 +20,7 @@
 package org.apache.axiom.ext.stax.datahandler;
 
 import javax.activation.DataHandler;
+import javax.xml.stream.XMLStreamException;
 
 /**
  * Extension interface for {@link javax.xml.stream.XMLStreamReader} implementations that
expose
@@ -126,8 +127,10 @@
      * force the implementation to load the binary content immediately.
      * 
      * @return the binary content for the current event
+     * 
+     * @throws XMLStreamException if an error occurs while loading the {@link DataHandler}
      */
-    DataHandler getDataHandler();
+    DataHandler getDataHandler() throws XMLStreamException;
     
     /**
      * Get a {@link DataHandlerProvider} instance for deferred loading of the binary content
for the

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/OMStAXWrapper.java
Sat Jul 11 23:58:35 2009
@@ -1289,7 +1289,7 @@
         }
     }
 
-    public DataHandler getDataHandler() {
+    public DataHandler getDataHandler() throws XMLStreamException {
         if (parser != null) {
             if (dataHandlerReader != null) {
                 return dataHandlerReader.getDataHandler();

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/DataHandlerReaderUtil.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/DataHandlerReaderUtil.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/DataHandlerReaderUtil.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/DataHandlerReaderUtil.java
Sat Jul 11 23:58:35 2009
@@ -21,11 +21,13 @@
 
 import javax.activation.DataHandler;
 import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerReader;
 import org.apache.axiom.om.OMConstants;
+import org.apache.axiom.om.OMException;
 
 /**
  * Utility class to work with the {@link XMLStreamReader} extension defined by
@@ -167,7 +169,11 @@
         } else if (propertyName.equals(OMConstants.IS_BINARY)) {
             return Boolean.valueOf(extension.isBinary());
         } else if (propertyName.equals(OMConstants.DATA_HANDLER)) {
-            return extension.getDataHandler();
+            try {
+                return extension.getDataHandler();
+            } catch (XMLStreamException ex) {
+                throw new OMException(ex);
+            }
         } else {
             return null;
         }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/StAXBuilder.java
Sat Jul 11 23:58:35 2009
@@ -258,9 +258,16 @@
      */
     private OMNode createOMText(OMContainer omContainer, int textType) {
         if (dataHandlerReader != null && dataHandlerReader.isBinary()) {
-            Object dataHandlerObject =
-                dataHandlerReader.isDeferred() ? (Object)dataHandlerReader.getDataHandlerProvider()
-                                               : (Object)dataHandlerReader.getDataHandler();
+            Object dataHandlerObject;
+            if (dataHandlerReader.isDeferred()) {
+                dataHandlerObject = dataHandlerReader.getDataHandlerProvider();
+            } else {
+                try {
+                    dataHandlerObject = dataHandlerReader.getDataHandler();
+                } catch (XMLStreamException ex) {
+                    throw new OMException(ex);
+                }
+            }
             OMText text = omfactory.createOMText(dataHandlerObject, true);
             text.setBinary(true);
             omContainer.addChild(text);

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
Sat Jul 11 23:58:35 2009
@@ -447,7 +447,11 @@
                 dataHandlerObject = ((XOPBuilder) builder)
                         .getDataHandler(contentID);
             } else if (dataHandlerObject instanceof DataHandlerProvider) {
-                dataHandlerObject = ((DataHandlerProvider)dataHandlerObject).getDataHandler();
+                try {
+                    dataHandlerObject = ((DataHandlerProvider)dataHandlerObject).getDataHandler();
+                } catch (XMLStreamException ex) {
+                    throw new OMException(ex);
+                }
             }
             return dataHandlerObject;
         }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?rev=793246&r1=793245&r2=793246&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
Sat Jul 11 23:58:35 2009
@@ -384,7 +384,11 @@
                 dataHandlerObject = ((XOPBuilder) builder)
                         .getDataHandler(contentID);
             } else if (dataHandlerObject instanceof DataHandlerProvider) {
-                dataHandlerObject = ((DataHandlerProvider)dataHandlerObject).getDataHandler();
+                try {
+                    dataHandlerObject = ((DataHandlerProvider)dataHandlerObject).getDataHandler();
+                } catch (XMLStreamException ex) {
+                    throw new OMException(ex);
+                }
             }
             return dataHandlerObject;
         }



Mime
View raw message