ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1698456 - in /webservices/axiom/trunk: aspects/core-aspects/src/main/java/org/apache/axiom/core/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ implem...
Date Sat, 29 Aug 2015 10:28:53 GMT
Author: veithen
Date: Sat Aug 29 10:28:52 2015
New Revision: 1698456

URL: http://svn.apache.org/r1698456
Log:
Clean up and optimize the buildWithAttachments code.

Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomChildNodeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCommentSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomEntityReferenceSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomProcessingInstructionSupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj
Sat Aug 29 10:28:52 2015
@@ -38,6 +38,10 @@ public aspect CoreParentNodeSupport {
         flags = (flags & ~Flags.STATE_MASK) | state;
     }
     
+    public boolean CoreParentNode.isExpanded() {
+        return true;
+    }
+    
     public void CoreParentNode.forceExpand() {}
     
     final Content CoreParentNode.getContent(boolean create) {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomChildNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomChildNodeSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomChildNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomChildNodeSupport.aj
Sat Aug 29 10:28:52 2015
@@ -61,10 +61,4 @@ public aspect AxiomChildNodeSupport {
         coreDetach(Policies.DETACH_POLICY);
         return this;
     }
-    
-    public void AxiomChildNode.buildWithAttachments() {
-        if (!isComplete()) {
-            build();
-        }
-    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCommentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCommentSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCommentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCommentSupport.aj
Sat Aug 29 10:28:52 2015
@@ -39,4 +39,7 @@ public aspect AxiomCommentSupport {
     public final void AxiomComment.internalSerialize(Serializer serializer, OMOutputFormat
format, boolean cache) throws OutputException {
         serializer.writeComment(coreGetCharacterData().toString());
     }
+    
+    public final void AxiomComment.buildWithAttachments() {
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomDocTypeSupport.aj
Sat Aug 29 10:28:52 2015
@@ -34,4 +34,7 @@ public aspect AxiomDocTypeSupport {
     public final void AxiomDocType.internalSerialize(Serializer serializer, OMOutputFormat
format, boolean cache) throws OutputException {
         serializer.writeDTD(coreGetRootName(), coreGetPublicId(), coreGetSystemId(), coreGetInternalSubset());
     }
+    
+    public final void AxiomDocType.buildWithAttachments() {
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomElementSupport.aj
Sat Aug 29 10:28:52 2015
@@ -571,4 +571,17 @@ public aspect AxiomElementSupport {
 
     public void AxiomElement.copyData(OMCloneOptions options, AxiomElement clone) {
     }
+
+    public final void AxiomElement.buildWithAttachments() {
+        if (getState() == INCOMPLETE) {
+            build();
+        }
+        if (isExpanded()) {
+            OMNode child = getFirstOMChild();
+            while (child != null) {
+                child.buildWithAttachments();
+                child = child.getNextOMSibling();
+            }
+        }
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomEntityReferenceSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomEntityReferenceSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomEntityReferenceSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomEntityReferenceSupport.aj
Sat Aug 29 10:28:52 2015
@@ -39,4 +39,7 @@ public aspect AxiomEntityReferenceSuppor
     public final String AxiomEntityReference.getReplacementText() {
         return coreGetReplacementText();
     }
+    
+    public final void AxiomEntityReference.buildWithAttachments() {
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomProcessingInstructionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomProcessingInstructionSupport.aj?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomProcessingInstructionSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomProcessingInstructionSupport.aj
Sat Aug 29 10:28:52 2015
@@ -42,4 +42,7 @@ public aspect AxiomProcessingInstruction
     public final void AxiomProcessingInstruction.internalSerialize(Serializer serializer,
OMOutputFormat format, boolean cache) throws OutputException {
         serializer.writeProcessingInstruction(coreGetTarget() + " ", coreGetCharacterData().toString());
     }
+    
+    public final void AxiomProcessingInstruction.buildWithAttachments() {
+    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java
Sat Aug 29 10:28:52 2015
@@ -19,8 +19,6 @@
 
 package org.apache.axiom.om.impl.dom;
 
-import java.util.Iterator;
-
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.dom.DOMConfigurationImpl;
 import org.apache.axiom.dom.DOMNSAwareElement;
@@ -96,20 +94,6 @@ public class NSAwareElement extends Elem
         return (ns != null) ? ns.getNamespaceURI() : null;
     }
 
-    /* (non-Javadoc)
-      * @see org.apache.axiom.om.OMNode#buildAll()
-      */
-    public void buildWithAttachments() {
-        if (getState() == INCOMPLETE) {
-            this.build();
-        }
-        Iterator iterator = getChildren();
-        while (iterator.hasNext()) {
-            OMNode node = (OMNode) iterator.next();
-            node.buildWithAttachments();
-        }
-    }
-
     public void normalize(DOMConfigurationImpl config) {
         if (config.isEnabled(DOMConfigurationImpl.NAMESPACES)) {
             OMNamespace namespace = getNamespace();

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sat Aug 29 10:28:52 2015
@@ -110,19 +110,5 @@ public class OMElementImpl extends OMNod
     public final int getLineNumber() {
         return lineNumber;
     }
-
-    /* (non-Javadoc)
-      * @see org.apache.axiom.om.OMNode#buildAll()
-      */
-    public void buildWithAttachments() {
-        if (getState() == INCOMPLETE) {
-            this.build();
-        }
-        Iterator iterator = getChildren();
-        while (iterator.hasNext()) {
-            OMNode node = (OMNode) iterator.next();
-            node.buildWithAttachments();
-        }
-    }
 }
 

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1698456&r1=1698455&r2=1698456&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
Sat Aug 29 10:28:52 2015
@@ -455,27 +455,6 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public void buildWithAttachments() {
-        
-        // If not done, force the parser to build the elements
-        if (getState() == INCOMPLETE) {
-            this.build();
-        }
-        
-        // If the OMSourcedElement is in in expanded form, then
-        // walk the descendents to make sure they are built. 
-        // If the OMSourcedElement is backed by a OMDataSource,
-        // we don't want to walk the children (because this will result
-        // in an unnecessary translation from OMDataSource to a full OM tree).
-        if (isExpanded()) {
-            Iterator iterator = getChildren();
-            while (iterator.hasNext()) {
-                OMNode node = (OMNode) iterator.next();
-                node.buildWithAttachments();
-            }
-        }
-    }
-
     /**
      * Provide access to the data source encapsulated in OMSourcedElement. 
      * This is usesful when we want to access the raw data in the data source.



Mime
View raw message