ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1700247 - in /webservices/axiom/trunk: aspects/core-aspects/src/main/java/org/apache/axiom/core/ aspects/dom-aspects/src/main/java/org/apache/axiom/dom/ aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ aspects/om-aspects/s...
Date Mon, 31 Aug 2015 13:32:04 GMT
Author: veithen
Date: Mon Aug 31 13:32:03 2015
New Revision: 1700247

URL: http://svn.apache.org/r1700247
Log:
Make the cloning logic converge a bit more.

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/ClonePolicy.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/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/CoreDocumentTypeDeclarationSupport.aj
    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/CoreLeafNodeSupport.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/dom-aspects/src/main/java/org/apache/axiom/dom/Policies.java
    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/Policies.java
    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/soap/impl/common/AxiomSOAPHeaderBlockSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPMessageSupport.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/DocumentFragmentImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareElement.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareElement.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamespaceDeclaration.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.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/soap/impl/llom/SOAPHeaderBlockImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,6 +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);
+    <T> CharacterData clone(ClonePolicy<T> policy, T options);
     String toString();
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/ClonePolicy.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/ClonePolicy.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/ClonePolicy.java (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/ClonePolicy.java Mon Aug 31 13:32:03 2015
@@ -21,8 +21,9 @@ package org.apache.axiom.core;
 /**
  * Defines how an object model tree is to be cloned.
  */
-public interface ClonePolicy {
-    boolean repairNamespaces();
-    boolean cloneAttributes();
-    boolean cloneChildren(NodeType nodeType);
+public interface ClonePolicy<T> {
+    boolean preserveModel(T options);
+    boolean repairNamespaces(T options);
+    boolean cloneAttributes(T options);
+    boolean cloneChildren(T options, NodeType nodeType);
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,7 +23,7 @@ public aspect CoreCDATASectionSupport {
         return NodeType.CDATA_SECTION;
     }
     
-    public final CoreNode CoreCDATASection.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreCDATASection.shallowClone(ClonePolicy<T> policy, T options) {
         return coreGetNodeFactory().createNode(CoreCDATASection.class);
     }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -48,7 +48,7 @@ public aspect CoreCharacterDataNodeSuppo
         this.data = data;
     }
     
-    public final CoreNode CoreCharacterDataNode.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreCharacterDataNode.shallowClone(ClonePolicy<T> policy, T options) {
         CoreCharacterDataNode clone = coreGetNodeFactory().createNode(CoreCharacterDataNode.class);
         clone.data = data instanceof CharacterData ? ((CharacterData)data).clone(policy, options) : data;
         clone.coreSetIgnorable(coreIsIgnorable());

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -48,5 +48,5 @@ public interface CoreChildNode extends C
      *            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);
+    <T> CoreNode coreClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -209,7 +209,7 @@ public aspect CoreChildNodeSupport {
         }
     }
 
-    public final CoreNode CoreChildNode.coreClone(ClonePolicy policy, Object options, CoreParentNode targetParent) {
+    public final <T> CoreNode CoreChildNode.coreClone(ClonePolicy<T> policy, T options, CoreParentNode targetParent) {
         CoreChildNode clone = (CoreChildNode)shallowClone(policy, options);
         if (targetParent != null) {
             targetParent.coreAppendChild(clone, false);

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,7 +23,7 @@ public aspect CoreCommentSupport {
         return NodeType.COMMENT;
     }
     
-    public final CoreNode CoreComment.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreComment.shallowClone(ClonePolicy<T> policy, T options) {
         return coreGetNodeFactory().createNode(CoreComment.class);
     }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -37,7 +37,7 @@ public aspect CoreDocumentFragmentSuppor
         ownerDocument = document;
     }
     
-    public final CoreNode CoreDocumentFragment.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreDocumentFragment.shallowClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -81,8 +81,13 @@ public aspect CoreDocumentSupport {
         this.standalone = standalone;
     }
     
-    public final CoreNode CoreDocument.shallowClone(ClonePolicy policy, Object options) {
-        // TODO
-        throw new UnsupportedOperationException();
+    public final <T> CoreNode CoreDocument.shallowClone(ClonePolicy<T> policy, T options) {
+        CoreDocument clone = (CoreDocument)coreGetNodeFactory().createNode(
+                policy.preserveModel(options) ? coreGetNodeClass() : coreGetNodeType().getInterface());
+        clone.coreSetXmlVersion(coreGetXmlVersion());
+        clone.coreSetXmlEncoding(coreGetXmlEncoding());
+        clone.coreSetStandalone(coreIsStandalone());
+        clone.coreSetInputEncoding(coreGetInputEncoding());
+        return clone;
     }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -60,7 +60,7 @@ public aspect CoreDocumentTypeDeclaratio
         this.internalSubset = internalSubset;
     }
     
-    public final CoreNode CoreDocumentTypeDeclaration.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreDocumentTypeDeclaration.shallowClone(ClonePolicy<T> policy, T options) {
         CoreDocumentTypeDeclaration clone = coreGetNodeFactory().createNode(CoreDocumentTypeDeclaration.class);
         clone.coreSetRootName(coreGetRootName());
         clone.coreSetPublicId(coreGetPublicId());

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -42,7 +42,7 @@ public aspect CoreEntityReferenceSupport
         this.replacementText = replacementText;
     }
     
-    public final CoreNode CoreEntityReference.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreEntityReference.shallowClone(ClonePolicy<T> policy, T options) {
         CoreEntityReference clone = coreGetNodeFactory().createNode(CoreEntityReference.class);
         clone.coreSetName(coreGetName());
         clone.coreSetReplacementText(coreGetReplacementText());

Modified: 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=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj (original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreLeafNodeSupport.aj Mon Aug 31 13:32:03 2015
@@ -19,6 +19,6 @@
 package org.apache.axiom.core;
 
 public aspect CoreLeafNodeSupport {
-    public final void CoreLeafNode.cloneChildrenIfNecessary(ClonePolicy policy, Object options, CoreNode clone) {
+    public final <T> void CoreLeafNode.cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone) {
     }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,7 +23,7 @@ public aspect CoreNSAwareAttributeSuppor
         return NodeType.NS_AWARE_ATTRIBUTE;
     }
     
-    public final CoreNode CoreNSAwareAttribute.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNSAwareAttribute.shallowClone(ClonePolicy<T> policy, T options) {
         CoreNSAwareAttribute clone = coreGetNodeFactory().createNode(CoreNSAwareAttribute.class);
         clone.coreSetName(this);
         clone.coreSetType(coreGetType());

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -31,7 +31,7 @@ public aspect CoreNSAwareElementSupport
         return namespaceURI.equals(coreGetNamespaceURI()) ? coreGetPrefix() : null;
     }
     
-    public final CoreNode CoreNSAwareElement.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNSAwareElement.shallowClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,7 +23,7 @@ public aspect CoreNSUnawareAttributeSupp
         return NodeType.NS_UNAWARE_ATTRIBUTE;
     }
     
-    public final CoreNode CoreNSUnawareAttribute.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNSUnawareAttribute.shallowClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -31,7 +31,7 @@ public aspect CoreNSUnawareElementSuppor
         return null;
     }
     
-    public final CoreNode CoreNSUnawareElement.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNSUnawareElement.shallowClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -23,7 +23,7 @@ public aspect CoreNamespaceDeclarationSu
         return NodeType.NAMESPACE_DECLARATION;
     }
     
-    public final CoreNode CoreNamespaceDeclaration.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNamespaceDeclaration.shallowClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -39,5 +39,8 @@ public interface CoreNode {
      *            the policy to use when cloning this node (and its children)
      * @return the clone of this node
      */
-    CoreNode coreClone(ClonePolicy policy, Object options);
+    <T> CoreNode coreClone(ClonePolicy<T> policy, T options);
+    
+    <T> CoreNode shallowClone(ClonePolicy<T> policy, T options);
+    <T> void cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone);
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -66,12 +66,9 @@ public aspect CoreNodeSupport {
         }
     }
     
-    public final CoreNode CoreNode.coreClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreNode.coreClone(ClonePolicy<T> policy, T 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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -292,8 +292,8 @@ public aspect CoreParentNodeSupport {
         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())) {
+    public final <T> void CoreParentNode.cloneChildrenIfNecessary(ClonePolicy<T> policy, T options, CoreNode clone) {
+        if (policy.cloneChildren(options, coreGetNodeType())) {
             CoreParentNode targetParent = (CoreParentNode)clone;
             if (getState() == COMPACT) {
                 Object content = this.content;

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -33,7 +33,7 @@ public aspect CoreProcessingInstructionS
         this.target = target;
     }
     
-    public final CoreNode CoreProcessingInstruction.shallowClone(ClonePolicy policy, Object options) {
+    public final <T> CoreNode CoreProcessingInstruction.shallowClone(ClonePolicy<T> policy, T options) {
         CoreProcessingInstruction clone = coreGetNodeFactory().createNode(CoreProcessingInstruction.class);
         clone.target = target;
         return clone;

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/Policies.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/Policies.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/Policies.java (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/Policies.java Mon Aug 31 13:32:03 2015
@@ -100,30 +100,40 @@ public final class Policies {
         }
     };
 
-    public static final ClonePolicy DEEP_CLONE = new ClonePolicy() {
-        public boolean repairNamespaces() {
+    public static final ClonePolicy<Void> DEEP_CLONE = new ClonePolicy<Void>() {
+        public boolean preserveModel(Void options) {
+            // This is not specified by the API, but it's compatible with versions before 1.2.14
+            return true;
+        }
+
+        public boolean repairNamespaces(Void options) {
             return false;
         }
 
-        public boolean cloneAttributes() {
+        public boolean cloneAttributes(Void options) {
             return true;
         }
 
-        public boolean cloneChildren(NodeType nodeType) {
+        public boolean cloneChildren(Void options, NodeType nodeType) {
             return true;
         }
     };
 
-    public static final ClonePolicy SHALLOW_CLONE = new ClonePolicy() {
-        public boolean repairNamespaces() {
+    public static final ClonePolicy<Void> SHALLOW_CLONE = new ClonePolicy<Void>() {
+        public boolean preserveModel(Void options) {
+            // This is not specified by the API, but it's compatible with versions before 1.2.14
+            return true;
+        }
+
+        public boolean repairNamespaces(Void options) {
             return false;
         }
 
-        public boolean cloneAttributes() {
+        public boolean cloneAttributes(Void options) {
             return true;
         }
 
-        public boolean cloneChildren(NodeType nodeType) {
+        public boolean cloneChildren(Void options, NodeType nodeType) {
             return nodeType == NodeType.NS_UNAWARE_ATTRIBUTE || nodeType == NodeType.NS_AWARE_ATTRIBUTE;
         }
     };

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -32,6 +32,7 @@ import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 
+import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.CoreAttribute;
 import org.apache.axiom.core.CoreParentNode;
 import org.apache.axiom.core.ElementAction;
@@ -557,17 +558,17 @@ public aspect AxiomElementSupport {
         }
     }
 
-    public final AxiomElement AxiomElement.shallowCloneWithoutAttributes(OMCloneOptions options, CoreParentNode targetParent, boolean namespaceRepairing) {
-        AxiomElement clone = (AxiomElement)coreGetNodeFactory().createNode(options.isPreserveModel() ? coreGetNodeClass() : AxiomElement.class);
+    public final <T> AxiomElement AxiomElement.shallowCloneWithoutAttributes(ClonePolicy<T> policy, T options, CoreParentNode targetParent, boolean namespaceRepairing) {
+        AxiomElement clone = (AxiomElement)coreGetNodeFactory().createNode(policy.preserveModel(options) ? coreGetNodeClass() : AxiomElement.class);
         if (targetParent != null) {
             targetParent.coreAppendChild(clone, false);
         }
         clone.initName(getLocalName(), getNamespace(), namespaceRepairing);
-        copyData(options, clone);
+        copyData(policy, options, clone);
         return clone;
     }
 
-    public void AxiomElement.copyData(OMCloneOptions options, AxiomElement clone) {
+    public <T> void AxiomElement.copyData(ClonePolicy<T> policy, T options, AxiomElement clone) {
     }
 
     public final void AxiomElement.buildWithAttachments() {

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/Policies.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/Policies.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/Policies.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/Policies.java Mon Aug 31 13:32:03 2015
@@ -27,6 +27,7 @@ import org.apache.axiom.core.NSAwareAttr
 import org.apache.axiom.core.NamespaceDeclarationMatcher;
 import org.apache.axiom.core.NodeMigrationPolicy;
 import org.apache.axiom.core.NodeType;
+import org.apache.axiom.om.OMCloneOptions;
 
 public final class Policies {
     private Policies() {}
@@ -57,16 +58,20 @@ public final class Policies {
         }
     };
     
-    public static final ClonePolicy CLONE_POLICY = new ClonePolicy() {
-        public boolean repairNamespaces() {
+    public static final ClonePolicy<OMCloneOptions> CLONE_POLICY = new ClonePolicy<OMCloneOptions>() {
+        public boolean preserveModel(OMCloneOptions options) {
+            return options.isPreserveModel();
+        }
+
+        public boolean repairNamespaces(OMCloneOptions options) {
             return true;
         }
 
-        public boolean cloneAttributes() {
+        public boolean cloneAttributes(OMCloneOptions options) {
             return true;
         }
 
-        public boolean cloneChildren(NodeType nodeType) {
+        public boolean cloneChildren(OMCloneOptions options, NodeType nodeType) {
             return true;
         }
     };

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -126,7 +126,7 @@ public final class TextContent implement
         }
     }
 
-    public CharacterData clone(ClonePolicy policy, Object options) {
+    public <T> CharacterData clone(ClonePolicy<T> policy, T 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).

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPHeaderBlockSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPHeaderBlockSupport.aj?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPHeaderBlockSupport.aj (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPHeaderBlockSupport.aj Mon Aug 31 13:32:03 2015
@@ -20,7 +20,7 @@ package org.apache.axiom.soap.impl.commo
 
 import javax.xml.namespace.QName;
 
-import org.apache.axiom.om.OMCloneOptions;
+import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.impl.common.AxiomElement;
@@ -121,7 +121,7 @@ public aspect AxiomSOAPHeaderBlockSuppor
         }
     }
 
-    public final void AxiomSOAPHeaderBlock.copyData(OMCloneOptions options, AxiomElement clone) {
+    public final <T> void AxiomSOAPHeaderBlock.copyData(ClonePolicy<T> policy, T options, AxiomElement clone) {
         // Copy the processed flag.  The other SOAPHeaderBlock information 
         // (e.g. role, mustUnderstand) are attributes on the tag and are copied elsewhere.
         Boolean processedFlag = options instanceof SOAPCloneOptions ? ((SOAPCloneOptions)options).getProcessedFlag() : null;

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPMessageSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPMessageSupport.aj?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPMessageSupport.aj (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/soap/impl/common/AxiomSOAPMessageSupport.aj Mon Aug 31 13:32:03 2015
@@ -18,12 +18,17 @@
  */
 package org.apache.axiom.soap.impl.common;
 
+import org.apache.axiom.core.CoreNode;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.impl.common.AxiomElement;
 import org.apache.axiom.om.impl.common.serializer.push.OutputException;
 import org.apache.axiom.om.impl.common.serializer.push.Serializer;
 
 public aspect AxiomSOAPMessageSupport {
+    public Class<? extends CoreNode> AxiomSOAPMessage.coreGetNodeClass() {
+        return AxiomSOAPMessage.class;
+    }
+
     // TODO: this violates OO design principles and should disappear in a future Axiom version
     public final void AxiomSOAPMessage.internalSerialize(Serializer serializer, OMOutputFormat format,
             boolean cache, boolean includeXMLDeclaration) throws OutputException {

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -20,7 +20,6 @@ package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.dom.DOMChildNode;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomChildNode;
 
@@ -29,7 +28,7 @@ public abstract class ChildNode extends
         super(factory);
     }
 
-    final NodeImpl clone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    final <T> NodeImpl clone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         return (ChildNode)coreClone(policy, options, targetParent);
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentFragmentImpl.java Mon Aug 31 13:32:03 2015
@@ -22,7 +22,6 @@ package org.apache.axiom.om.impl.dom;
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.NodeFactory;
 import org.apache.axiom.dom.DOMDocumentFragment;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 
 public class DocumentFragmentImpl extends ParentNode implements DOMDocumentFragment {
@@ -35,7 +34,7 @@ public class DocumentFragmentImpl extend
         return (NodeFactory)getOMFactory();
     }
 
-    ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         return new DocumentFragmentImpl(getOMFactory());
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/DocumentImpl.java Mon Aug 31 13:32:03 2015
@@ -27,7 +27,6 @@ import org.apache.axiom.core.CoreModelEx
 import org.apache.axiom.core.NodeMigrationPolicy;
 import org.apache.axiom.dom.DOMDocument;
 import org.apache.axiom.dom.DOMExceptionTranslator;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -233,24 +232,10 @@ public class DocumentImpl extends Parent
         throw new UnsupportedOperationException("TODO");
     }
 
-    ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
-        DocumentImpl clone;
-        if (options.isPreserveModel()) {
-            clone = createClone(options);
-        } else {
-            clone = new DocumentImpl(getOMFactory());
-        }
-        clone.coreSetXmlVersion(coreGetXmlVersion());
-        clone.coreSetXmlEncoding(coreGetXmlEncoding());
-        clone.coreSetStandalone(coreIsStandalone());
-        clone.coreSetInputEncoding(coreGetInputEncoding());
-        return clone;
+    <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
+        return (ParentNode)shallowClone(policy, options);
     }
 
-    protected DocumentImpl createClone(OMCloneOptions options) {
-        return new DocumentImpl(getOMFactory());
-    }
-    
     public final void build() {
         defaultBuild();
     }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ElementImpl.java Mon Aug 31 13:32:03 2015
@@ -63,14 +63,14 @@ public abstract class ElementImpl extend
         return prefix;
     }
 
-    final ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    final <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         ElementImpl clone = createClone(options, targetParent, policy);
         NamedNodeMap attributes = getAttributes();
         for (int i=0, l=attributes.getLength(); i<l; i++) {
             AttrImpl attr = (AttrImpl)attributes.item(i);
             AttrImpl clonedAttr = (AttrImpl)attr.clone(options, null, policy);
             clonedAttr.coreSetSpecified(attr.coreGetSpecified());
-            if (policy.repairNamespaces() && attr instanceof NSAwareAttribute) {
+            if (policy.repairNamespaces(options) && attr instanceof NSAwareAttribute) {
                 NSAwareAttribute nsAwareAttr = (NSAwareAttribute)attr;
                 String namespaceURI = nsAwareAttr.coreGetNamespaceURI();
                 if (namespaceURI.length() != 0) {
@@ -86,7 +86,7 @@ public abstract class ElementImpl extend
         return clone;
     }
 
-    abstract ElementImpl createClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy);
+    abstract <T> ElementImpl createClone(T options, ParentNode targetParent, ClonePolicy<T> policy);
     
     /*
      * DOM-Level 3 methods

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSAwareAttribute.java Mon Aug 31 13:32:03 2015
@@ -20,7 +20,6 @@ package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.dom.DOMNSAwareAttribute;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.impl.OMAttributeEx;
@@ -40,7 +39,7 @@ public final class NSAwareAttribute exte
     }
 
     @Override
-    final ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    final <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         return (ParentNode)shallowClone(policy, options);
     }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -53,8 +53,8 @@ public class NSAwareElement extends Elem
     }
 
     @Override
-    final ElementImpl createClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
-        return (ElementImpl)shallowCloneWithoutAttributes(options, targetParent, policy.repairNamespaces());
+    final <T> ElementImpl createClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
+        return (ElementImpl)shallowCloneWithoutAttributes(policy, options, targetParent, policy.repairNamespaces(options));
     }
 
     public void setLineNumber(int lineNumber) {

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareAttribute.java Mon Aug 31 13:32:03 2015
@@ -21,7 +21,6 @@ package org.apache.axiom.om.impl.dom;
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.NodeFactory;
 import org.apache.axiom.dom.DOMNSUnawareAttribute;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 
 public class NSUnawareAttribute extends AttrImpl implements DOMNSUnawareAttribute {
@@ -34,8 +33,8 @@ public class NSUnawareAttribute extends
     }
 
     @Override
-    ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent,
-            ClonePolicy policy) {
+    <T> ParentNode shallowClone(T options, ParentNode targetParent,
+            ClonePolicy<T> policy) {
         // TODO Auto-generated method stub
         throw new UnsupportedOperationException();
     }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareElement.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareElement.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NSUnawareElement.java Mon Aug 31 13:32:03 2015
@@ -21,7 +21,6 @@ package org.apache.axiom.om.impl.dom;
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.NodeFactory;
 import org.apache.axiom.dom.DOMNSUnawareElement;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 
 public class NSUnawareElement extends ElementImpl implements DOMNSUnawareElement {
@@ -38,7 +37,7 @@ public class NSUnawareElement extends El
     }
 
     @Override
-    ElementImpl createClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    <T> ElementImpl createClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         // TODO
         throw new UnsupportedOperationException();
     }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamespaceDeclaration.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamespaceDeclaration.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamespaceDeclaration.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NamespaceDeclaration.java Mon Aug 31 13:32:03 2015
@@ -20,7 +20,6 @@ package org.apache.axiom.om.impl.dom;
 
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.dom.DOMNamespaceDeclaration;
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
 import org.apache.axiom.om.impl.common.OMNamespaceImpl;
@@ -31,7 +30,7 @@ public final class NamespaceDeclaration
     }
 
     @Override
-    final ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    final <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         NamespaceDeclaration clone = new NamespaceDeclaration(getOMFactory());
         // TODO: this is ugly, but we are expected to create a shallow clone and can't copy the value;
         //       this will be fixed when the clone code is moved to om-aspects

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/NodeImpl.java Mon Aug 31 13:32:03 2015
@@ -58,10 +58,7 @@ public abstract class NodeImpl implement
     }
 
     public final Node cloneNode(boolean deep) {
-        OMCloneOptions options = new OMCloneOptions();
-        // This is not specified by the API, but it's compatible with versions before 1.2.14
-        options.setPreserveModel(true);
-        NodeImpl clone = clone(options, null, deep ? Policies.DEEP_CLONE : Policies.SHALLOW_CLONE);
+        NodeImpl clone = clone(null, null, deep ? Policies.DEEP_CLONE : Policies.SHALLOW_CLONE);
         if (!(clone instanceof DocumentImpl)) {
             clone.coreSetOwnerDocument(ownerDocument());
         }
@@ -334,5 +331,5 @@ public abstract class NodeImpl implement
         return (OMInformationItem)clone(options, null, org.apache.axiom.om.impl.common.Policies.CLONE_POLICY);
     }
 
-    abstract NodeImpl clone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy);
+    abstract <T> NodeImpl clone(T options, ParentNode targetParent, ClonePolicy<T> policy);
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ParentNode.java Mon Aug 31 13:32:03 2015
@@ -150,9 +150,9 @@ public abstract class ParentNode extends
         return false;
     }
 
-    final NodeImpl clone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy) {
+    final <T> NodeImpl clone(T options, ParentNode targetParent, ClonePolicy<T> policy) {
         ParentNode clone = shallowClone(options, targetParent, policy);
-        if (policy.cloneChildren(coreGetNodeType())) {
+        if (policy.cloneChildren(options, coreGetNodeType())) {
             for (Node child = getFirstChild(); child != null; child = child.getNextSibling()) {
                 ((NodeImpl)child).clone(options, clone, policy);
             }
@@ -160,5 +160,5 @@ public abstract class ParentNode extends
         return clone;
     }
     
-    abstract ParentNode shallowClone(OMCloneOptions options, ParentNode targetParent, ClonePolicy policy);
+    abstract <T> ParentNode shallowClone(T options, ParentNode targetParent, ClonePolicy<T> policy);
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPMessageImpl.java Mon Aug 31 13:32:03 2015
@@ -19,7 +19,6 @@
 
 package org.apache.axiom.soap.impl.dom;
 
-import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -46,8 +45,4 @@ public class SOAPMessageImpl extends Doc
             throw new OMException("Child not allowed; must be a SOAPEnvelope");
         }
     }
-
-    protected DocumentImpl createClone(OMCloneOptions options) {
-        return new SOAPMessageImpl(getOMFactory());
-    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java Mon Aug 31 13:32:03 2015
@@ -20,13 +20,13 @@
 package org.apache.axiom.om.impl.llom;
 
 import org.apache.axiom.om.OMCloneOptions;
-import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMInformationItem;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.common.AxiomDocument;
+import org.apache.axiom.om.impl.common.Policies;
 
 import java.util.Iterator;
 
@@ -59,23 +59,10 @@ public class OMDocumentImpl extends OMSe
     }
     
     public OMInformationItem clone(OMCloneOptions options) {
-        AxiomDocument targetDocument;
-        if (options.isPreserveModel()) {
-            targetDocument = (AxiomDocument)createClone(options);
-        } else {
-            targetDocument = (AxiomDocument)getOMFactory().createOMDocument();
-        }
-        targetDocument.setXMLVersion(getXMLVersion());
-        targetDocument.setXMLEncoding(getXMLEncoding());
-        targetDocument.setCharsetEncoding(getCharsetEncoding());
-        targetDocument.setStandalone(isStandalone());
+        AxiomDocument targetDocument = (AxiomDocument)shallowClone(Policies.CLONE_POLICY, options);
         for (Iterator it = getChildren(); it.hasNext(); ) {
             ((OMNodeImpl)it.next()).clone(options, targetDocument);
         }
         return targetDocument;
     }
-
-    protected OMDocument createClone(OMCloneOptions options) {
-        return getOMFactory().createOMDocument();
-    }
 }

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=1700247&r1=1700246&r2=1700247&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 Mon Aug 31 13:32:03 2015
@@ -29,6 +29,7 @@ import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.common.AxiomContainer;
 import org.apache.axiom.om.impl.common.AxiomElement;
+import org.apache.axiom.om.impl.common.Policies;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
@@ -88,7 +89,7 @@ public class OMElementImpl extends OMNod
     }
     
     final OMNode defaultClone(OMCloneOptions options, AxiomContainer targetParent) {
-        AxiomElement targetElement = shallowCloneWithoutAttributes(options, targetParent, true);
+        AxiomElement targetElement = shallowCloneWithoutAttributes(Policies.CLONE_POLICY, options, targetParent, true);
         for (Iterator it = getAllDeclaredNamespaces(); it.hasNext(); ) {
             OMNamespace ns = (OMNamespace)it.next();
             targetElement.declareNamespace(ns);

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java Mon Aug 31 13:32:03 2015
@@ -25,6 +25,7 @@ import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMSourcedElement;
+import org.apache.axiom.om.impl.common.Policies;
 import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
 import org.apache.axiom.soap.SOAPFactory;
 import org.apache.axiom.soap.impl.common.AxiomSOAPHeaderBlock;
@@ -47,7 +48,7 @@ public abstract class SOAPHeaderBlockImp
     
     protected OMSourcedElement createClone(OMCloneOptions options, OMDataSource ds) {
         AxiomSOAPHeaderBlock clone = (AxiomSOAPHeaderBlock)((SOAPFactory)getOMFactory()).createSOAPHeaderBlock(ds);
-        copyData(options, clone);
+        copyData(Policies.CLONE_POLICY, options, clone);
         return clone;
     }
 }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java?rev=1700247&r1=1700246&r2=1700247&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java Mon Aug 31 13:32:03 2015
@@ -19,8 +19,6 @@
 
 package org.apache.axiom.soap.impl.llom;
 
-import org.apache.axiom.om.OMCloneOptions;
-import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
@@ -47,10 +45,4 @@ public class SOAPMessageImpl extends OMD
             throw new OMException("Child not allowed; must be a SOAPEnvelope");
         }
     }
-
-    protected OMDocument createClone(OMCloneOptions options) {
-        // Note: we need to use getOMFactory here (instead of the factory attribute)
-        // directly because the factory for a SOAPMessage may be determined lazily.
-        return new SOAPMessageImpl(getOMFactory());
-    }
 }



Mime
View raw message