ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1698405 - 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/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/ im...
Date Fri, 28 Aug 2015 20:25:51 GMT
Author: veithen
Date: Fri Aug 28 20:25:50 2015
New Revision: 1698405

URL: http://svn.apache.org/r1698405
Log:
Create a cloning infrastructure in the core model and use that to clone text nodes in higher
layers.

Added:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java
  (with props)
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj
  (with props)
Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CharacterData.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCDATASectionSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNodeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNode.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNodeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCommentSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentFragmentSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReference.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReferenceSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareAttributeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareElementSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareAttributeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareElementSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamespaceDeclarationSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNode.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNodeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreParentNodeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreProcessingInstructionSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCDATASectionSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCharacterDataNodeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomText.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomTextSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/TextContent.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CommentImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CharacterData.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CharacterData.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CharacterData.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CharacterData.java
Fri Aug 28 20:25:50 2015
@@ -23,5 +23,6 @@ package org.apache.axiom.core;
  * {@link CoreCharacterDataNode} is either a {@link String} object or an instance of this
interface.
  */
 public interface CharacterData {
+    CharacterData clone(ClonePolicy policy, Object options);
     String toString();
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCDATASectionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCDATASectionSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCDATASectionSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCDATASectionSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,8 @@ public aspect CoreCDATASectionSupport {
     public final int CoreCDATASection.coreGetNodeType() {
         return CDATA_SECTION_NODE;
     }
+    
+    public final CoreNode CoreCDATASection.shallowClone(ClonePolicy policy, Object options)
{
+        return coreGetNodeFactory().createCDATASection();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNode.java
Fri Aug 28 20:25:50 2015
@@ -18,7 +18,7 @@
  */
 package org.apache.axiom.core;
 
-public interface CoreCharacterDataNode extends CoreChildNode, CoreCharacterDataContainer
{
+public interface CoreCharacterDataNode extends CoreLeafNode, CoreCharacterDataContainer {
     void coreSetCharacterData(Object data);
     
     /**

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNodeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCharacterDataNodeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -47,4 +47,11 @@ public aspect CoreCharacterDataNodeSuppo
     public final void CoreCharacterDataNode.coreSetCharacterData(Object data, DetachPolicy
detachPolicy) {
         this.data = data;
     }
+    
+    public final CoreNode CoreCharacterDataNode.shallowClone(ClonePolicy policy, Object options)
{
+        CoreCharacterDataNode clone = coreGetNodeFactory().createCharacterDataNode();
+        clone.data = data instanceof CharacterData ? ((CharacterData)data).clone(policy,
options) : data;
+        clone.coreSetIgnorable(coreIsIgnorable());
+        return clone;
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNode.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNode.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNode.java
Fri Aug 28 20:25:50 2015
@@ -38,4 +38,15 @@ public interface CoreChildNode extends C
      *         the builder has not yet started to build the next sibling
      */
     CoreChildNode coreGetNextSiblingIfAvailable();
+
+    /**
+     * Clone this node according to the provided policy.
+     * 
+     * @param policy
+     *            the policy to use when cloning this node (and its children)
+     * @param targetParent
+     *            the node to which the clone should be added; may be <code>null</code>
+     * @return the clone of this node
+     */
+    CoreNode coreClone(ClonePolicy policy, Object options, CoreParentNode targetParent);
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNodeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreChildNodeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -208,4 +208,13 @@ public aspect CoreChildNodeSupport {
             internalSetParent(newParent);
         }
     }
+
+    public final CoreNode CoreChildNode.coreClone(ClonePolicy policy, Object options, CoreParentNode
targetParent) {
+        CoreChildNode clone = (CoreChildNode)shallowClone(policy, options);
+        if (targetParent != null) {
+            targetParent.coreAppendChild(clone, false);
+        }
+        cloneChildrenIfNecessary(policy, options, clone);
+        return clone;
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCommentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCommentSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCommentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreCommentSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,9 @@ public aspect CoreCommentSupport {
     public final int CoreComment.coreGetNodeType() {
         return COMMENT_NODE;
     }
+    
+    public final CoreNode CoreComment.shallowClone(ClonePolicy policy, Object options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentFragmentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentFragmentSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentFragmentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentFragmentSupport.aj
Fri Aug 28 20:25:50 2015
@@ -36,4 +36,9 @@ public aspect CoreDocumentFragmentSuppor
     public final void CoreDocumentFragment.coreSetOwnerDocument(CoreDocument document) {
         ownerDocument = document;
     }
+    
+    public final CoreNode CoreDocumentFragment.shallowClone(ClonePolicy policy, Object options)
{
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentSupport.aj
Fri Aug 28 20:25:50 2015
@@ -80,4 +80,9 @@ public aspect CoreDocumentSupport {
     public final void CoreDocument.coreSetStandalone(boolean standalone) {
         this.standalone = standalone;
     }
+    
+    public final CoreNode CoreDocument.shallowClone(ClonePolicy policy, Object options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclaration.java
Fri Aug 28 20:25:50 2015
@@ -18,6 +18,6 @@
  */
 package org.apache.axiom.core;
 
-public interface CoreDocumentTypeDeclaration extends CoreChildNode {
+public interface CoreDocumentTypeDeclaration extends CoreLeafNode {
 
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreDocumentTypeDeclarationSupport.aj
Fri Aug 28 20:25:50 2015
@@ -59,4 +59,9 @@ public aspect CoreDocumentTypeDeclaratio
     public final void CoreDocumentTypeDeclaration.coreSetInternalSubset(String internalSubset)
{
         this.internalSubset = internalSubset;
     }
+    
+    public final CoreNode CoreDocumentTypeDeclaration.shallowClone(ClonePolicy policy, Object
options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReference.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReference.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReference.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReference.java
Fri Aug 28 20:25:50 2015
@@ -18,6 +18,6 @@
  */
 package org.apache.axiom.core;
 
-public interface CoreEntityReference extends CoreChildNode {
+public interface CoreEntityReference extends CoreLeafNode {
 
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReferenceSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReferenceSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReferenceSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreEntityReferenceSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,9 @@ public aspect CoreEntityReferenceSupport
     public final int CoreEntityReference.coreGetNodeType() {
         return ENTITY_REFERENCE_NODE;
     }
+    
+    public final CoreNode CoreEntityReference.shallowClone(ClonePolicy policy, Object options)
{
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Added: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java?rev=1698405&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java
(added)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java
Fri Aug 28 20:25:50 2015
@@ -0,0 +1,23 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.core;
+
+public interface CoreLeafNode extends CoreChildNode {
+
+}

Propchange: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNode.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj?rev=1698405&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj
(added)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -0,0 +1,24 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.axiom.core;
+
+public aspect CoreLeafNodeSupport {
+    public final void CoreLeafNode.cloneChildrenIfNecessary(ClonePolicy policy, Object options,
CoreNode clone) {
+    }
+}

Propchange: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareAttributeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareAttributeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareAttributeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,9 @@ public aspect CoreNSAwareAttributeSuppor
     public final int CoreNSAwareAttribute.coreGetNodeType() {
         return NS_AWARE_ATTRIBUTE_NODE;
     }
+    
+    public final CoreNode CoreNSAwareAttribute.shallowClone(ClonePolicy policy, Object options)
{
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareElementSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareElementSupport.aj
Fri Aug 28 20:25:50 2015
@@ -30,4 +30,9 @@ public aspect CoreNSAwareElementSupport
     public final String CoreNSAwareElement.getImplicitPrefix(String namespaceURI) {
         return namespaceURI.equals(coreGetNamespaceURI()) ? coreGetPrefix() : null;
     }
+    
+    public final CoreNode CoreNSAwareElement.shallowClone(ClonePolicy policy, Object options)
{
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareAttributeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareAttributeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareAttributeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,9 @@ public aspect CoreNSUnawareAttributeSupp
     public final int CoreNSUnawareAttribute.coreGetNodeType() {
         return NS_UNAWARE_ATTRIBUTE_NODE;
     }
+    
+    public final CoreNode CoreNSUnawareAttribute.shallowClone(ClonePolicy policy, Object
options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareElementSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareElementSupport.aj
Fri Aug 28 20:25:50 2015
@@ -30,4 +30,9 @@ public aspect CoreNSUnawareElementSuppor
     public final String CoreNSUnawareElement.getImplicitPrefix(String namespaceURI) {
         return null;
     }
+    
+    public final CoreNode CoreNSUnawareElement.shallowClone(ClonePolicy policy, Object options)
{
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamespaceDeclarationSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamespaceDeclarationSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamespaceDeclarationSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamespaceDeclarationSupport.aj
Fri Aug 28 20:25:50 2015
@@ -22,4 +22,9 @@ public aspect CoreNamespaceDeclarationSu
     public final int CoreNamespaceDeclaration.coreGetNodeType() {
         return NAMESPACE_DECLARATION_NODE;
     }
+    
+    public final CoreNode CoreNamespaceDeclaration.shallowClone(ClonePolicy policy, Object
options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNode.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNode.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNode.java
Fri Aug 28 20:25:50 2015
@@ -18,7 +18,6 @@
  */
 package org.apache.axiom.core;
 
-
 public interface CoreNode {
     /**
      * The node is a {@link CoreDocument}.
@@ -95,4 +94,13 @@ public interface CoreNode {
      * @return one of the constants defined by {@link CoreNode} identifying the type of node
      */
     int coreGetNodeType();
+
+    /**
+     * Clone this node according to the provided policy.
+     * 
+     * @param policy
+     *            the policy to use when cloning this node (and its children)
+     * @return the clone of this node
+     */
+    CoreNode coreClone(ClonePolicy policy, Object options);
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNodeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNodeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -60,4 +60,13 @@ public aspect CoreNodeSupport {
             flags &= ~flag;
         }
     }
+    
+    public final CoreNode CoreNode.coreClone(ClonePolicy policy, Object options) {
+        CoreNode clone = shallowClone(policy, options);
+        cloneChildrenIfNecessary(policy, options, clone);
+        return clone;
+    }
+    
+    public abstract CoreNode CoreNode.shallowClone(ClonePolicy policy, Object options);
+    public abstract void CoreNode.cloneChildrenIfNecessary(ClonePolicy policy, Object options,
CoreNode clone);
 }

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=1698405&r1=1698404&r2=1698405&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
Fri Aug 28 20:25:50 2015
@@ -287,4 +287,23 @@ public aspect CoreParentNodeSupport {
     public final <T extends CoreElement> NodeIterator<T> CoreParentNode.coreGetElements(Axis
axis, Class<T> type, ElementMatcher<? super T> matcher, String namespaceURI, String
name, ExceptionTranslator exceptionTranslator, DetachPolicy detachPolicy) {
         return new ElementsIterator<T>(this, axis, type, matcher, namespaceURI, name,
exceptionTranslator, detachPolicy);
     }
+
+    public final void CoreParentNode.cloneChildrenIfNecessary(ClonePolicy policy, Object
options, CoreNode clone) {
+        if (policy.cloneChildren(coreGetNodeType())) {
+            CoreParentNode targetParent = (CoreParentNode)clone;
+            if (getState() == COMPACT) {
+                Object content = this.content;
+                if (content instanceof CharacterData) {
+                    content = ((CharacterData)content).clone(policy, options);
+                }
+                targetParent.coreSetCharacterData(content, null);
+            } else {
+                CoreChildNode child = coreGetFirstChild();
+                while (child != null) {
+                    child.coreClone(policy, options, targetParent);
+                    child = child.coreGetNextSibling();
+                }
+            }
+        }
+    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreProcessingInstructionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreProcessingInstructionSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreProcessingInstructionSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreProcessingInstructionSupport.aj
Fri Aug 28 20:25:50 2015
@@ -32,4 +32,9 @@ public aspect CoreProcessingInstructionS
     public final void CoreProcessingInstruction.coreSetTarget(String target) {
         this.target = target;
     }
+    
+    public final CoreNode CoreProcessingInstruction.shallowClone(ClonePolicy policy, Object
options) {
+        // TODO
+        throw new UnsupportedOperationException();
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCDATASectionSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCDATASectionSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCDATASectionSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCDATASectionSupport.aj
Fri Aug 28 20:25:50 2015
@@ -24,8 +24,4 @@ public aspect AxiomCDATASectionSupport {
     public final int AxiomCDATASection.getType() {
         return OMNode.CDATA_SECTION_NODE;
     }
-    
-    public final AxiomText AxiomCDATASection.createInstanceOfSameType() {
-        return (AxiomText)coreGetNodeFactory().createCDATASection();
-    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCharacterDataNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCharacterDataNodeSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCharacterDataNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomCharacterDataNodeSupport.aj
Fri Aug 28 20:25:50 2015
@@ -24,10 +24,4 @@ public aspect AxiomCharacterDataNodeSupp
     public final int AxiomCharacterDataNode.getType() {
         return coreIsIgnorable() ? OMNode.SPACE_NODE : OMNode.TEXT_NODE;
     }
-    
-    public final AxiomText AxiomCharacterDataNode.createInstanceOfSameType() {
-        AxiomCharacterDataNode instance = (AxiomCharacterDataNode)coreGetNodeFactory().createCharacterDataNode();
-        instance.coreSetIgnorable(coreIsIgnorable());
-        return instance;
-    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomText.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomText.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomText.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomText.java
Fri Aug 28 20:25:50 2015
@@ -22,5 +22,5 @@ import org.apache.axiom.core.CoreCharact
 import org.apache.axiom.om.OMText;
 
 public interface AxiomText extends OMText, AxiomLeafNode, CoreCharacterDataContainer {
-    AxiomText createInstanceOfSameType();
+
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomTextSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomTextSupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomTextSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomTextSupport.aj
Fri Aug 28 20:25:50 2015
@@ -147,15 +147,4 @@ public aspect AxiomTextSupport {
     public final void AxiomText.setContentID(String cid) {
         getTextContent(true).contentID = cid;
     }
-
-    public final AxiomText AxiomText.doClone() {
-        AxiomText clone = createInstanceOfSameType();
-        Object content = coreGetCharacterData();
-        if (content instanceof TextContent) {
-            clone.coreSetCharacterData(new TextContent((TextContent)content), Policies.DETACH_POLICY);
-        } else {
-            clone.coreSetCharacterData(content, Policies.DETACH_POLICY);
-        }
-        return clone;
-    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/TextContent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/TextContent.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/TextContent.java
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/TextContent.java
Fri Aug 28 20:25:50 2015
@@ -24,7 +24,9 @@ import javax.activation.DataHandler;
 
 import org.apache.axiom.attachments.ByteArrayDataSource;
 import org.apache.axiom.core.CharacterData;
+import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
+import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.util.base64.Base64Utils;
 
@@ -123,4 +125,13 @@ public final class TextContent implement
             return value.toCharArray();
         }
     }
+
+    public CharacterData clone(ClonePolicy policy, Object options) {
+        if (binary && options instanceof OMCloneOptions && ((OMCloneOptions)options).isFetchDataHandlers())
{
+            // Force loading of the reference to the DataHandler and ensure that its content
is
+            // completely fetched into memory (or temporary storage).
+            ((DataHandler)getDataHandler()).getDataSource();
+        }
+        return new TextContent(this);
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/factory/AxiomNodeFactorySupport.aj
Fri Aug 28 20:25:50 2015
@@ -149,11 +149,7 @@ public aspect AxiomNodeFactorySupport {
 
     public final OMText AxiomNodeFactory.createOMText(OMContainer parent, OMText source)
{
         // TODO: this doesn't necessarily produce a node with the expected OMFactory
-        AxiomText node = ((AxiomText)source).doClone();
-        if (parent != null) {
-            ((OMContainerEx)parent).addChild(node, false);
-        }
-        return node;
+        return (AxiomText)((AxiomText)source).coreClone(Policies.CLONE_POLICY, null, (AxiomContainer)parent);
     }
 
     public final OMText AxiomNodeFactory.createOMText(Object dataHandler, boolean optimize)
{

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
Fri Aug 28 20:25:50 2015
@@ -30,17 +30,12 @@ public abstract class ChildNode extends
     }
 
     final NodeImpl clone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy)
{
-        beforeClone(options);
-        ChildNode clone = createClone();
+        ChildNode clone = createClone(options);
         if (targetParent != null) {
             targetParent.coreAppendChild(clone, false);
         }
         return clone;
     }
     
-    void beforeClone(OMCloneOptions options) {
-        // By default, do nothing
-    }
-    
-    abstract ChildNode createClone();
+    abstract ChildNode createClone(OMCloneOptions options);
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CommentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CommentImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CommentImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/CommentImpl.java
Fri Aug 28 20:25:50 2015
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.dom.DOMComment;
 import org.apache.axiom.dom.Policies;
+import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomComment;
 
@@ -30,7 +31,7 @@ public class CommentImpl extends LeafNod
         coreSetCharacterData(value, Policies.DETACH_POLICY);
     }
 
-    ChildNode createClone() {
+    ChildNode createClone(OMCloneOptions options) {
         return new CommentImpl(getData(), getOMFactory());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentTypeImpl.java
Fri Aug 28 20:25:50 2015
@@ -20,6 +20,7 @@
 package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.dom.DOMDocumentType;
+import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomDocType;
 
@@ -28,7 +29,7 @@ public class DocumentTypeImpl extends Le
         super(factory);
     }
 
-    ChildNode createClone() {
+    ChildNode createClone(OMCloneOptions options) {
         return (ChildNode)getOMFactory().createOMDocType(null, coreGetRootName(), coreGetPublicId(),
coreGetSystemId(), coreGetInternalSubset());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
Fri Aug 28 20:25:50 2015
@@ -21,6 +21,7 @@ package org.apache.axiom.om.impl.dom;
 import static org.apache.axiom.dom.DOMExceptionTranslator.newDOMException;
 
 import org.apache.axiom.dom.DOMEntityReference;
+import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
@@ -57,7 +58,7 @@ public class EntityReferenceImpl extends
         return replacementText;
     }
 
-    ChildNode createClone() {
+    ChildNode createClone(OMCloneOptions options) {
         return new EntityReferenceImpl(name, replacementText, getOMFactory());
     }
 

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ProcessingInstructionImpl.java
Fri Aug 28 20:25:50 2015
@@ -20,6 +20,7 @@
 package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.dom.DOMProcessingInstruction;
+import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
 
@@ -28,7 +29,7 @@ public class ProcessingInstructionImpl e
         super(factory);
     }
 
-    ChildNode createClone() {
+    ChildNode createClone(OMCloneOptions options) {
         return (ChildNode)getOMFactory().createOMProcessingInstruction(null, coreGetTarget(),
coreGetCharacterData().toString());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/TextNodeImpl.java
Fri Aug 28 20:25:50 2015
@@ -22,14 +22,13 @@ package org.apache.axiom.om.impl.dom;
 import static org.apache.axiom.dom.DOMExceptionTranslator.newDOMException;
 
 import org.apache.axiom.dom.DOMTextNode;
+import org.apache.axiom.dom.Policies;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomText;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Text;
 
-import javax.activation.DataHandler;
-
 public abstract class TextNodeImpl extends LeafNode implements DOMTextNode, AxiomText {
     public TextNodeImpl(OMFactory factory) {
         super(factory);
@@ -84,15 +83,7 @@ public abstract class TextNodeImpl exten
         return value != null ? value : "";
     }
 
-    void beforeClone(OMCloneOptions options) {
-        if (isBinary() && options.isFetchDataHandlers()) {
-            // Force loading of the reference to the DataHandler and ensure that its content
is
-            // completely fetched into memory (or temporary storage).
-            ((DataHandler)getDataHandler()).getDataSource();
-        }
-    }
-
-    final ChildNode createClone() {
-        return (ChildNode)doClone();
+    final ChildNode createClone(OMCloneOptions options) {
+        return (ChildNode)coreClone(Policies.DEEP_CLONE, options);
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java?rev=1698405&r1=1698404&r2=1698405&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
(original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMTextImpl.java
Fri Aug 28 20:25:50 2015
@@ -25,8 +25,7 @@ import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.common.AxiomContainer;
 import org.apache.axiom.om.impl.common.AxiomText;
-
-import javax.activation.DataHandler;
+import org.apache.axiom.om.impl.common.Policies;
 
 public abstract class OMTextImpl extends OMLeafNode implements AxiomText, OMConstants {
     public OMTextImpl(OMFactory factory) {
@@ -34,11 +33,6 @@ public abstract class OMTextImpl extends
     }
 
     OMNode clone(OMCloneOptions options, AxiomContainer targetParent) {
-        if (isBinary() && options.isFetchDataHandlers()) {
-            // Force loading of the reference to the DataHandler and ensure that its content
is
-            // completely fetched into memory (or temporary storage).
-            ((DataHandler)getDataHandler()).getDataSource();
-        }
-        return getOMFactory().createOMText(targetParent, this);
+        return (OMNode)coreClone(Policies.CLONE_POLICY, options, targetParent);
     }
 }



Mime
View raw message