ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1484132 - in /webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull: Navigator.java OMXMLStreamReaderExAdapter.java PullSerializer.java PullSerializerState.java SwitchingWrapper.java
Date Sat, 18 May 2013 16:02:57 GMT
Author: veithen
Date: Sat May 18 16:02:57 2013
New Revision: 1484132

URL: http://svn.apache.org/r1484132
Log:
* Improved documentation.
* Gave SwitchingWrapper a more meaningful name.

Added:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
      - copied, changed from r1484127, webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
Removed:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
Modified:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializerState.java

Copied: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
(from r1484127, webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java?p2=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java&p1=webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java&r1=1484127&r2=1484132&rev=1484132&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/Navigator.java
Sat May 18 16:02:57 2013
@@ -63,12 +63,12 @@ import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
- * Class used internally by {@link OMXMLStreamReaderExAdapter}.
+ * {@link PullSerializerState} implementation that generates events from nodes in the OM
tree.
  */
-final class SwitchingWrapper extends PullSerializerState
+final class Navigator extends PullSerializerState
     implements DataHandlerReader, CharacterDataReader, DTDReader, XMLStreamConstants {
     
-    private static final Log log = LogFactory.getLog(SwitchingWrapper.class);
+    private static final Log log = LogFactory.getLog(Navigator.class);
     
     private final PullSerializer serializer;
     
@@ -134,7 +134,7 @@ final class SwitchingWrapper extends Pul
      * @param cache
      * @param preserveNamespaceContext
      */
-    SwitchingWrapper(PullSerializer serializer, OMXMLParserWrapper builder, OMContainer startNode,
+    Navigator(PullSerializer serializer, OMXMLParserWrapper builder, OMContainer startNode,
                             boolean cache, boolean preserveNamespaceContext) {
         this.serializer = serializer;
         this.builder = builder;
@@ -195,8 +195,8 @@ final class SwitchingWrapper extends Pul
             // START quick & dirty hack
             if (node instanceof OMSourcedElement) {
                 // TODO: Need to force expansion to solve an issue in Axis2 where the returned
QName is incorrect.
-                //       Note that in previous versions of SwitchingWrapper, the sourced
element was always expanded
-                //       at this point (because SwitchingWrapper was looking 2 nodes ahead).
+                //       Note that in previous versions of Navigator, the sourced element
was always expanded
+                //       at this point (because Navigator was looking 2 nodes ahead).
                 ((OMElement)node).getFirstOMChild();
             }
             // END quick & dirty hack
@@ -530,7 +530,7 @@ final class SwitchingWrapper extends Pul
                 staxBuilder.close();
             }
         } finally {
-            // Note that as a side effect of this instruction, the SwitchingWrapper instance
+            // Note that as a side effect of this instruction, the Navigator instance
             // will become unreachable and the parser can be GC'd or reused.
             serializer.switchState(ClosedState.INSTANCE);
         }

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java?rev=1484132&r1=1484131&r2=1484132&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/OMXMLStreamReaderExAdapter.java
Sat May 18 16:02:57 2013
@@ -56,8 +56,8 @@ public class OMXMLStreamReaderExAdapter 
 
     public void setInlineMTOM(boolean value) {
         // For inlineMTOM=false, we insert an XOPEncodingStreamReader proxy between
-        // us and SwitchingWrapper.
-        // For inlineMTOM=true, we remove it and delegate directly to SwitchingWrapper.
+        // us and PullSerializer.
+        // For inlineMTOM=true, we remove it and delegate directly to PullSerializer.
         if (value) {
             if (xopEncoder != null) {
                 xopEncoder = null;

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java?rev=1484132&r1=1484131&r2=1484132&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializer.java
Sat May 18 16:02:57 2013
@@ -55,7 +55,7 @@ public final class PullSerializer extend
 
     public PullSerializer(OMXMLParserWrapper builder, OMContainer startNode,
             boolean cache, boolean preserveNamespaceContext) {
-        state = new SwitchingWrapper(this, builder, startNode, cache, preserveNamespaceContext);
+        state = new Navigator(this, builder, startNode, cache, preserveNamespaceContext);
     }
     
     /**

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializerState.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializerState.java?rev=1484132&r1=1484131&r2=1484132&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializerState.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/PullSerializerState.java
Sat May 18 16:02:57 2013
@@ -29,6 +29,22 @@ import org.apache.axiom.ext.stax.datahan
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.impl.OMXMLStreamReaderEx;
 
+/**
+ * Encapsulates the state of the {@link PullSerializer}. Different subclasses are used depending
on
+ * the position reached in the OM tree or original document and the state of the serializer:
+ * <ul>
+ * <li>{@link PullThroughWrapper} is used if caching is turned off and the node for
the current
+ * event has not been instantiated. In this case, events are pulled directly from the underlying
+ * parser.
+ * <li>{@link IncludeWrapper} is used for events pulled directly from an {@link OMDataSource}.
+ * <li>{@link EndDocumentState} is used when the {@link XMLStreamConstants#END_DOCUMENT}
event has
+ * been reached.
+ * <li>{@link ClosedState} is used when {@link XMLStreamReader#close()} has been called
on the
+ * serializer.
+ * <li>In all other cases, {@link Navigator} is used. This class is responsible for
+ * generating StAX events from nodes in the object model.
+ * </ul>
+ */
 abstract class PullSerializerState {
     /**
      * Get the {@link DTDReader} extension.



Mime
View raw message