ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1293569 - in /webservices/commons/trunk/modules/axiom/modules: axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/ axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/
Date Sat, 25 Feb 2012 10:23:59 GMT
Author: veithen
Date: Sat Feb 25 10:23:59 2012
New Revision: 1293569

URL: http://svn.apache.org/viewvc?rev=1293569&view=rev
Log:
Code reuse.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
      - copied, changed from r1293553, webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java
Removed:
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java
Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java

Copied: webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
(from r1293553, webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java)
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java?p2=webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java&p1=webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java&r1=1293553&r2=1293569&rev=1293569&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMContainerHelper.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMContainerHelper.java
Sat Feb 25 10:23:59 2012
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.impl.llom;
+package org.apache.axiom.om.impl.common;
 
 import javax.xml.stream.XMLStreamReader;
 
@@ -25,12 +25,11 @@ import org.apache.axiom.om.OMXMLParserWr
 import org.apache.axiom.om.OMXMLStreamReader;
 import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.common.OMStAXWrapper;
 import org.apache.axiom.om.util.OMXMLStreamReaderValidator;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-class OMContainerHelper {
+public final class OMContainerHelper {
     private static final Log log = LogFactory.getLog(OMContainerHelper.class);
     
     private static final OMXMLStreamReaderConfiguration defaultReaderConfiguration = new
OMXMLStreamReaderConfiguration();
@@ -42,7 +41,7 @@ class OMContainerHelper {
     }
     
     public static XMLStreamReader getXMLStreamReader(OMContainer container, boolean cache,
OMXMLStreamReaderConfiguration configuration) {
-        OMXMLParserWrapper builder = ((OMSerializableImpl)container).builder;
+        OMXMLParserWrapper builder = container.getBuilder();
         if (builder != null && builder instanceof StAXOMBuilder) {
             if (!container.isComplete()) {
                 if (((StAXOMBuilder) builder).isLookahead()) {
@@ -53,7 +52,7 @@ class OMContainerHelper {
         
         // The om tree was built by hand and is already complete
         OMXMLStreamReader reader = null;
-        boolean done = ((OMSerializableImpl)container).done;
+        boolean done = container.isComplete();
         if ((builder == null) && done) {
             reader = new OMStAXWrapper(null, container, false, configuration.isPreserveNamespaceContext());
         } else {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java?rev=1293569&r1=1293568&r2=1293569&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/OMStAXWrapper.java
Sat Feb 25 10:23:59 2012
@@ -41,7 +41,7 @@ import org.apache.commons.logging.LogFac
  * This class does intentionally does not implement XMLStreamReaderContainer because
  * it does not wrap a parser (it wraps an OM graph).
  */
-public class OMStAXWrapper extends StreamReaderDelegate implements OMXMLStreamReaderEx {
+class OMStAXWrapper extends StreamReaderDelegate implements OMXMLStreamReaderEx {
     private static final Log log = LogFactory.getLog(OMStAXWrapper.class);
     
     private final SwitchingWrapper switchingWrapper;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1293569&r1=1293568&r2=1293569&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
Sat Feb 25 10:23:59 2012
@@ -36,8 +36,8 @@ import org.apache.axiom.om.impl.builder.
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
+import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
-import org.apache.axiom.om.impl.common.OMStAXWrapper;
 import org.apache.axiom.om.impl.dom.factory.OMDOMFactory;
 import org.apache.axiom.om.impl.jaxp.OMSource;
 import org.apache.axiom.om.impl.traverse.OMChildrenIterator;
@@ -695,19 +695,11 @@ public abstract class ParentNode extends
     }
 
     public XMLStreamReader getXMLStreamReader(boolean cache) {
-        return getXMLStreamReader(cache, new OMXMLStreamReaderConfiguration());
+        return OMContainerHelper.getXMLStreamReader(this, cache);
     }
     
     public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration
configuration) {
-        if ((builder == null) && !cache) {
-            throw new UnsupportedOperationException(
-                    "This element was not created in a manner to be switched");
-        }
-        if (builder != null && builder.isCompleted() && !cache) {
-            throw new UnsupportedOperationException(
-                    "The parser is already consumed!");
-        }
-        return new OMStAXWrapper(builder, this, cache, configuration.isPreserveNamespaceContext());
+        return OMContainerHelper.getXMLStreamReader(this, cache, configuration);
     }
 
     public SAXSource getSAXSource(boolean cache) {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java?rev=1293569&r1=1293568&r2=1293569&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
Sat Feb 25 10:23:59 2012
@@ -33,6 +33,7 @@ import org.apache.axiom.om.impl.OMNodeEx
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
+import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
 import org.apache.axiom.om.impl.common.OMDocumentImplUtil;
 import org.apache.axiom.om.impl.jaxp.OMSource;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1293569&r1=1293568&r2=1293569&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sat Feb 25 10:23:59 2012
@@ -41,6 +41,7 @@ import org.apache.axiom.om.impl.common.O
 import org.apache.axiom.om.impl.common.OMChildrenLocalNameIterator;
 import org.apache.axiom.om.impl.common.OMChildrenNamespaceIterator;
 import org.apache.axiom.om.impl.common.OMChildrenQNameIterator;
+import org.apache.axiom.om.impl.common.OMContainerHelper;
 import org.apache.axiom.om.impl.common.OMDescendantsIterator;
 import org.apache.axiom.om.impl.common.OMElementImplUtil;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;



Mime
View raw message