ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1700297 - in /webservices/axiom/trunk/aspects: core-aspects/src/main/java/org/apache/axiom/core/ om-aspects/src/main/java/org/apache/axiom/om/impl/common/
Date Mon, 31 Aug 2015 18:49:24 GMT
Author: veithen
Date: Mon Aug 31 18:49:23 2015
New Revision: 1700297

URL: http://svn.apache.org/r1700297
Log:
Improve how the name of an element/attribute is copied during cloning.

Added:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamedNode.java
  (with props)
Modified:
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElement.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.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/CoreNSAwareNamedNode.java
    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/CoreNSUnawareNamedNode.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNodeSupport.aj
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
    webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttributeSupport.aj
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomNamedInformationItemSupport.aj

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElement.java?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElement.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElement.java
Mon Aug 31 18:49:23 2015
@@ -20,7 +20,7 @@ package org.apache.axiom.core;
 
 import java.util.Iterator;
 
-public interface CoreElement extends CoreChildNode, CoreMixedContentContainer, DeferringParentNode
{
+public interface CoreElement extends CoreChildNode, CoreMixedContentContainer, CoreNamedNode,
DeferringParentNode {
     /**
      * Specifies the value that should be returned by
      * {@link CoreElement#coreSetAttribute(AttributeMatcher, String, String, CoreAttribute,
NodeMigrationPolicy, ReturnValue)}.

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreElementSupport.aj
Mon Aug 31 18:49:23 2015
@@ -254,7 +254,7 @@ public aspect CoreElementSupport {
     public final <T> CoreNode CoreElement.shallowClone(ClonePolicy<T> policy,
T options) {
         CoreElement clone = (CoreElement)coreGetNodeFactory().createNode(
                 policy.preserveModel(options) ? coreGetNodeClass() : coreGetNodeType().getInterface());
-        copyName(clone);
+        clone.initName(this);
         CoreAttribute attr = coreGetFirstAttribute();
         while (attr != null) {
             clone.internalAppendAttribute((CoreAttribute)attr.coreClone(policy, options));
@@ -266,8 +266,6 @@ public aspect CoreElementSupport {
         return clone;
     }
 
-    abstract void CoreElement.copyName(CoreElement clone);
-    
     public <T> void CoreElement.initAncillaryData(ClonePolicy<T> policy, T options,
CoreElement other) {
     }
 }

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=1700297&r1=1700296&r2=1700297&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 18:49:23 2015
@@ -22,11 +22,4 @@ public aspect CoreNSAwareAttributeSuppor
     public final NodeType CoreNSAwareAttribute.coreGetNodeType() {
         return NodeType.NS_AWARE_ATTRIBUTE;
     }
-    
-    public final <T> CoreNode CoreNSAwareAttribute.shallowClone(ClonePolicy<T>
policy, T options) {
-        CoreNSAwareAttribute clone = coreGetNodeFactory().createNode(CoreNSAwareAttribute.class);
-        clone.coreSetName(this);
-        clone.coreSetType(coreGetType());
-        return clone;
-    }
 }

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=1700297&r1=1700296&r2=1700297&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 18:49:23 2015
@@ -30,8 +30,4 @@ public aspect CoreNSAwareElementSupport
     public final String CoreNSAwareElement.getImplicitPrefix(String namespaceURI) {
         return namespaceURI.equals(coreGetNamespaceURI()) ? coreGetPrefix() : null;
     }
-    
-    final void CoreNSAwareElement.copyName(CoreElement clone) {
-        ((CoreNSAwareElement)clone).coreSetName(this);
-    }
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSAwareNamedNode.java
Mon Aug 31 18:49:23 2015
@@ -21,11 +21,10 @@ package org.apache.axiom.core;
 /**
  * Represents a namespace aware named information item.
  */
-public interface CoreNSAwareNamedNode {
+public interface CoreNSAwareNamedNode extends CoreNamedNode {
     String coreGetNamespaceURI();
     String coreGetPrefix();
     void coreSetPrefix(String prefix);
     String coreGetLocalName();
     void coreSetName(String namespaceURI, String localName, String prefix);
-    void coreSetName(CoreNSAwareNamedNode other);
 }

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=1700297&r1=1700296&r2=1700297&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 18:49:23 2015
@@ -22,9 +22,4 @@ public aspect CoreNSUnawareAttributeSupp
     public final NodeType CoreNSUnawareAttribute.coreGetNodeType() {
         return NodeType.NS_UNAWARE_ATTRIBUTE;
     }
-    
-    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/CoreNSUnawareNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNode.java
Mon Aug 31 18:49:23 2015
@@ -21,7 +21,7 @@ package org.apache.axiom.core;
 /**
  * Represents a namespace unaware named information item.
  */
-public interface CoreNSUnawareNamedNode {
+public interface CoreNSUnawareNamedNode extends CoreNamedNode {
     String coreGetName();
     void coreSetName(String name);
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNodeSupport.aj?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNSUnawareNamedNodeSupport.aj
Mon Aug 31 18:49:23 2015
@@ -28,4 +28,8 @@ public aspect CoreNSUnawareNamedNodeSupp
     public final void CoreNSUnawareNamedNode.coreSetName(String name) {
         this.name = name;
     }
+    
+    public final void CoreNSUnawareNamedNode.initName(CoreNamedNode other) {
+        coreSetName(((CoreNSUnawareNamedNode)other).coreGetName());
+    }
 }

Added: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamedNode.java?rev=1700297&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamedNode.java
(added)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreNamedNode.java
Mon Aug 31 18:49:23 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 CoreNamedNode extends CoreNode {
+    void initName(CoreNamedNode other);
+}

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

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttribute.java
Mon Aug 31 18:49:23 2015
@@ -21,7 +21,7 @@ package org.apache.axiom.core;
 /**
  * Represents an attribute information item that is not a namespace declaration.
  */
-public interface CoreTypedAttribute extends CoreAttribute {
+public interface CoreTypedAttribute extends CoreAttribute, CoreNamedNode {
     String coreGetType();
     void coreSetType(String type);
 }

Modified: webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttributeSupport.aj?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttributeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/core-aspects/src/main/java/org/apache/axiom/core/CoreTypedAttributeSupport.aj
Mon Aug 31 18:49:23 2015
@@ -28,4 +28,12 @@ public aspect CoreTypedAttributeSupport
     public final void CoreTypedAttribute.coreSetType(String type) {
         this.type = type;
     }
+    
+    public final <T> CoreNode CoreTypedAttribute.shallowClone(ClonePolicy<T>
policy, T options) {
+        CoreTypedAttribute clone = (CoreTypedAttribute)coreGetNodeFactory().createNode(
+                policy.preserveModel(options) ? coreGetNodeClass() : coreGetNodeType().getInterface());
+        clone.initName(this);
+        clone.coreSetType(coreGetType());
+        return clone;
+    }
 }

Modified: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomNamedInformationItemSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomNamedInformationItemSupport.aj?rev=1700297&r1=1700296&r2=1700297&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomNamedInformationItemSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomNamedInformationItemSupport.aj
Mon Aug 31 18:49:23 2015
@@ -20,7 +20,7 @@ package org.apache.axiom.om.impl.common;
 
 import javax.xml.namespace.QName;
 
-import org.apache.axiom.core.CoreNSAwareNamedNode;
+import org.apache.axiom.core.CoreNamedNode;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMNamespace;
 
@@ -122,9 +122,10 @@ public aspect AxiomNamedInformationItemS
         qName = null;
     }
 
-    public final void AxiomNamedInformationItem.coreSetName(CoreNSAwareNamedNode other) {
-        localName = other.coreGetLocalName();
-        namespace = ((AxiomNamedInformationItem)other).getNamespace();
+    public final void AxiomNamedInformationItem.initName(CoreNamedNode other) {
+        AxiomNamedInformationItem o = (AxiomNamedInformationItem)other;
+        localName = o.coreGetLocalName();
+        namespace = o.getNamespace();
         qName = null;
     }
     



Mime
View raw message