You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2015/06/12 21:42:33 UTC

svn commit: r1685150 - 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/

Author: veithen
Date: Fri Jun 12 19:42:33 2015
New Revision: 1685150

URL: http://svn.apache.org/r1685150
Log:
Prefer final methods.

Added:
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttribute.java   (with props)
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttributeSupport.aj   (with props)
Modified:
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentFragmentSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMEntityReferenceSupport.aj
    webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
    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/NodeImpl.java

Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttribute.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttribute.java?rev=1685150&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttribute.java (added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttribute.java Fri Jun 12 19:42:33 2015
@@ -0,0 +1,26 @@
+/*
+ * 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;
+
+import org.apache.axiom.core.CoreAttribute;
+import org.w3c.dom.Attr;
+
+public interface DOMAttribute extends Attr, CoreAttribute {
+
+}

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

Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttributeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttributeSupport.aj?rev=1685150&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttributeSupport.aj (added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMAttributeSupport.aj Fri Jun 12 19:42:33 2015
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+import org.w3c.dom.NamedNodeMap;
+
+public aspect DOMAttributeSupport {
+    public final boolean DOMAttribute.hasAttributes() {
+        return false;
+    }
+
+    public final NamedNodeMap DOMAttribute.getAttributes() {
+        return null;
+    }
+}

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

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentFragmentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentFragmentSupport.aj?rev=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentFragmentSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentFragmentSupport.aj Fri Jun 12 19:42:33 2015
@@ -21,6 +21,7 @@ package org.apache.axiom.dom;
 import static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
 
 import org.w3c.dom.DOMException;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 
 public aspect DOMDocumentFragmentSupport {
@@ -51,15 +52,23 @@ public aspect DOMDocumentFragmentSupport
         return null;
     }
 
+    public final void DOMDocumentFragment.setPrefix(String prefix) throws DOMException {
+        throw newDOMException(DOMException.NAMESPACE_ERR);
+    }
+
     public final String DOMDocumentFragment.getNamespaceURI() {
         return null;
     }
 
-    public final void DOMDocumentFragment.setPrefix(String prefix) throws DOMException {
-        throw newDOMException(DOMException.NAMESPACE_ERR);
+    public final String DOMDocumentFragment.getLocalName() {
+        return null;
     }
 
-    public final String DOMDocumentFragment.getLocalName() {
+    public final boolean DOMDocumentFragment.hasAttributes() {
+        return false;
+    }
+
+    public final NamedNodeMap DOMDocumentFragment.getAttributes() {
         return null;
     }
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj?rev=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMDocumentSupport.aj Fri Jun 12 19:42:33 2015
@@ -22,6 +22,7 @@ import org.w3c.dom.CDATASection;
 import org.w3c.dom.DOMConfiguration;
 import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.Text;
 
@@ -55,6 +56,14 @@ public aspect DOMDocumentSupport {
         return null;
     }
 
+    public final boolean DOMDocument.hasAttributes() {
+        return false;
+    }
+
+    public final NamedNodeMap DOMDocument.getAttributes() {
+        return null;
+    }
+
     public final Element DOMDocument.getDocumentElement() {
         return (Element)coreGetDocumentElement();
     }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMEntityReferenceSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMEntityReferenceSupport.aj?rev=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMEntityReferenceSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMEntityReferenceSupport.aj Fri Jun 12 19:42:33 2015
@@ -18,6 +18,11 @@
  */
 package org.apache.axiom.dom;
 
+import static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.NamedNodeMap;
+
 public aspect DOMEntityReferenceSupport {
     public final String DOMEntityReference.getNodeValue() {
         return null;
@@ -25,4 +30,28 @@ public aspect DOMEntityReferenceSupport
 
     public final void DOMEntityReference.setNodeValue(String nodeValue) {
     }
+
+    public final String DOMEntityReference.getPrefix() {
+        return null;
+    }
+
+    public final void DOMEntityReference.setPrefix(String prefix) throws DOMException {
+        throw newDOMException(DOMException.NAMESPACE_ERR);
+    }
+
+    public final String DOMEntityReference.getNamespaceURI() {
+        return null;
+    }
+
+    public final String DOMEntityReference.getLocalName() {
+        return null;
+    }
+
+    public final boolean DOMEntityReference.hasAttributes() {
+        return false;
+    }
+
+    public final NamedNodeMap DOMEntityReference.getAttributes() {
+        return null;
+    }
 }

Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj?rev=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj Fri Jun 12 19:42:33 2015
@@ -21,10 +21,27 @@ package org.apache.axiom.dom;
 import static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
 
 import org.w3c.dom.DOMException;
+import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 public aspect DOMLeafNodeSupport {
+    public final String DOMLeafNode.getPrefix() {
+        return null;
+    }
+
+    public final void DOMLeafNode.setPrefix(String prefix) throws DOMException {
+        throw newDOMException(DOMException.NAMESPACE_ERR);
+    }
+
+    public final String DOMLeafNode.getNamespaceURI() {
+        return null;
+    }
+
+    public final String DOMLeafNode.getLocalName() {
+        return null;
+    }
+
     public final boolean DOMLeafNode.hasChildNodes() {
         return false;
     }
@@ -56,4 +73,12 @@ public aspect DOMLeafNodeSupport {
     public final Node DOMLeafNode.replaceChild(Node newChild, Node oldChild) throws DOMException {
         throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
     }
+
+    public final boolean DOMLeafNode.hasAttributes() {
+        return false;
+    }
+
+    public final NamedNodeMap DOMLeafNode.getAttributes() {
+        return null;
+    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java?rev=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/AttrImpl.java Fri Jun 12 19:42:33 2015
@@ -24,6 +24,7 @@ import static org.apache.axiom.dom.DOMEx
 import javax.xml.XMLConstants;
 
 import org.apache.axiom.core.NonDeferringParentNode;
+import org.apache.axiom.dom.DOMAttribute;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMConstants;
@@ -41,7 +42,7 @@ import org.w3c.dom.Text;
 import org.w3c.dom.TypeInfo;
 
 /** Implementation of <code>org.w3c.dom.Attr</code> and <code>org.apache.axiom.om.OMAttribute</code> */
-public class AttrImpl extends RootNode implements OMAttributeEx, AxiomAttribute, Attr, NamedNode, NonDeferringParentNode {
+public class AttrImpl extends RootNode implements OMAttributeEx, AxiomAttribute, DOMAttribute, NamedNode, NonDeferringParentNode {
     private String type;
 
     /** Flag used to mark an attribute as per the DOM Level 3 specification */

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=1685150&r1=1685149&r2=1685150&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java Fri Jun 12 19:42:33 2015
@@ -18,15 +18,12 @@
  */
 package org.apache.axiom.om.impl.dom;
 
-import static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
-
 import org.apache.axiom.dom.DOMChildNode;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.w3c.dom.DOMException;
 import org.w3c.dom.Element;
 
 public abstract class ChildNode extends NodeImpl implements DOMChildNode, OMNode {
@@ -83,20 +80,4 @@ public abstract class ChildNode extends
         ParentNode parent = (ParentNode)coreGetParent();
         return parent instanceof Element ? parent.lookupPrefix(namespaceURI) : null;
     }
-
-    public final String getPrefix() {
-        return null;
-    }
-
-    public final String getNamespaceURI() {
-        return null;
-    }
-
-    public final void setPrefix(String prefix) throws DOMException {
-        throw newDOMException(DOMException.NAMESPACE_ERR);
-    }
-
-    public final String getLocalName() {
-        return null;
-    }
 }

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=1685150&r1=1685149&r2=1685150&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 Fri Jun 12 19:42:33 2015
@@ -57,20 +57,6 @@ public abstract class NodeImpl extends I
         //Parent node should override this 
     }
 
-    public boolean hasAttributes() {
-        return false; // overridden in ElementImpl
-    }
-
-    /**
-     * Returns the collection of attributes associated with this node, or null if none. At this
-     * writing, Element is the only type of node which will ever have attributes.
-     *
-     * @see ElementImpl
-     */
-    public NamedNodeMap getAttributes() {
-        return null; // overridden in ElementImpl
-    }
-
     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