ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1694512 - in /webservices/axiom/trunk: aspects/dom-aspects/src/main/java/org/apache/axiom/dom/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/
Date Thu, 06 Aug 2015 14:37:14 GMT
Author: veithen
Date: Thu Aug  6 14:37:14 2015
New Revision: 1694512

URL: http://svn.apache.org/r1694512
Log:
Unify the Attr#getName and Element#getTagName code.

Added:
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNamedNode.java
  (with props)
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttribute.java
  (with props)
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttributeSupport.aj
  (with props)
Removed:
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttributeSupport.aj
Modified:
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElement.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElementSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareAttribute.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNode.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNodeSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttribute.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNode.java
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNodeSupport.aj
    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

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElement.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElement.java?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElement.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElement.java
Thu Aug  6 14:37:14 2015
@@ -21,6 +21,6 @@ package org.apache.axiom.dom;
 import org.apache.axiom.core.CoreElement;
 import org.w3c.dom.Element;
 
-public interface DOMElement extends DOMChildNode, DOMParentNode, Element, CoreElement {
+public interface DOMElement extends DOMChildNode, DOMParentNode, DOMNamedNode, Element, CoreElement
{
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElementSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElementSupport.aj?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElementSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMElementSupport.aj
Thu Aug  6 14:37:14 2015
@@ -55,6 +55,10 @@ public aspect DOMElementSupport {
     public void DOMElement.setNodeValue(String nodeValue) {
     }
 
+    public final String DOMElement.getTagName() {
+        return internalGetName();
+    }
+    
     public final TypeInfo DOMElement.getSchemaTypeInfo() {
         throw new UnsupportedOperationException();
     }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareAttribute.java?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareAttribute.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareAttribute.java
Thu Aug  6 14:37:14 2015
@@ -20,6 +20,6 @@ package org.apache.axiom.dom;
 
 import org.apache.axiom.core.CoreNSAwareAttribute;
 
-public interface DOMNSAwareAttribute extends DOMAttribute, DOMNSAwareNamedNode, CoreNSAwareAttribute
{
+public interface DOMNSAwareAttribute extends DOMTypedAttribute, DOMNSAwareNamedNode, CoreNSAwareAttribute
{
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNode.java?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNode.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNode.java
Thu Aug  6 14:37:14 2015
@@ -20,6 +20,6 @@ package org.apache.axiom.dom;
 
 import org.apache.axiom.shared.INSAwareNamedNode;
 
-public interface DOMNSAwareNamedNode extends INSAwareNamedNode, DOMNode {
+public interface DOMNSAwareNamedNode extends INSAwareNamedNode, DOMNamedNode {
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNodeSupport.aj?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSAwareNamedNodeSupport.aj
Thu Aug  6 14:37:14 2015
@@ -32,4 +32,14 @@ public aspect DOMNSAwareNamedNodeSupport
         }
         coreSetPrefix(prefix);
     }
+    
+    public final String DOMNSAwareNamedNode.internalGetName() {
+        String prefix = coreGetPrefix();
+        String localName = coreGetLocalName();
+        if (prefix.length() == 0) {
+            return localName;
+        } else {
+            return prefix + ":" + localName;
+        }
+    }
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttribute.java?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttribute.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareAttribute.java
Thu Aug  6 14:37:14 2015
@@ -20,6 +20,6 @@ package org.apache.axiom.dom;
 
 import org.apache.axiom.core.CoreNSUnawareAttribute;
 
-public interface DOMNSUnawareAttribute extends DOMAttribute, DOMNSUnawareNamedNode, CoreNSUnawareAttribute
{
+public interface DOMNSUnawareAttribute extends DOMTypedAttribute, DOMNSUnawareNamedNode,
CoreNSUnawareAttribute {
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNode.java?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNode.java
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNode.java
Thu Aug  6 14:37:14 2015
@@ -20,6 +20,6 @@ package org.apache.axiom.dom;
 
 import org.apache.axiom.core.CoreNSUnawareNamedNode;
 
-public interface DOMNSUnawareNamedNode extends CoreNSUnawareNamedNode, DOMNode {
+public interface DOMNSUnawareNamedNode extends CoreNSUnawareNamedNode, DOMNamedNode {
 
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNodeSupport.aj?rev=1694512&r1=1694511&r2=1694512&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNodeSupport.aj
(original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNSUnawareNamedNodeSupport.aj
Thu Aug  6 14:37:14 2015
@@ -36,4 +36,8 @@ public aspect DOMNSUnawareNamedNodeSuppo
     public final String DOMNSUnawareNamedNode.getLocalName() {
         return null;
     }
+    
+    public final String DOMNSUnawareNamedNode.internalGetName() {
+        return coreGetName();
+    }
 }

Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNamedNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNamedNode.java?rev=1694512&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNamedNode.java
(added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMNamedNode.java
Thu Aug  6 14:37:14 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.dom;
+
+public interface DOMNamedNode extends DOMNode {
+    String internalGetName();
+}

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

Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttribute.java?rev=1694512&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttribute.java
(added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttribute.java
Thu Aug  6 14:37:14 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.dom;
+
+public interface DOMTypedAttribute extends DOMAttribute, DOMNamedNode{
+
+}

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

Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttributeSupport.aj?rev=1694512&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttributeSupport.aj
(added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMTypedAttributeSupport.aj
Thu Aug  6 14:37:14 2015
@@ -0,0 +1,25 @@
+/*
+ * 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.dom;
+
+public aspect DOMTypedAttributeSupport {
+    public final String DOMTypedAttribute.getName() {
+        return internalGetName();
+    }
+}

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

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=1694512&r1=1694511&r2=1694512&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
Thu Aug  6 14:37:14 2015
@@ -92,25 +92,6 @@ public class ElementImpl extends ParentN
     }
 
     // /
-    // /org.w3c.dom.Node methods
-    // /
-
-    public String getTagName() {
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        if (namespace != null) {
-            if (namespace.getPrefix() == null
-                    || "".equals(namespace.getPrefix())) {
-                return localName;
-            } else {
-                return namespace.getPrefix() + ":" + localName;
-            }
-        } else {
-            return localName;
-        }
-    }
-
-    // /
     // /OmElement 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=1694512&r1=1694511&r2=1694512&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
Thu Aug  6 14:37:14 2015
@@ -18,8 +18,6 @@
  */
 package org.apache.axiom.om.impl.dom;
 
-import javax.xml.XMLConstants;
-
 import org.apache.axiom.dom.DOMNSAwareAttribute;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMConstants;
@@ -49,24 +47,6 @@ public final class NSAwareAttribute exte
         internalSetNamespace(ns);
     }
 
-    public String getName() {
-        OMNamespace namespace = getNamespace();
-        String localName = getLocalName();
-        if (namespace != null) {
-            if ((XMLConstants.XMLNS_ATTRIBUTE.equals(localName))) {
-                return localName;
-            } else if (XMLConstants.XMLNS_ATTRIBUTE_NS_URI.equals(namespace.getNamespaceURI()))
{
-                return XMLConstants.XMLNS_ATTRIBUTE + ":" + localName;
-            } else if (namespace.getPrefix().equals("")) {
-                return localName;
-            } else {
-                return namespace.getPrefix() + ":" + localName;
-            }
-        } else {
-            return localName;
-        }
-    }
-
     public String toString() {
         OMNamespace namespace = getNamespace();
         String localName = getLocalName();



Mime
View raw message