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 2014/07/20 00:25:46 UTC
svn commit: r1611981 - 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/
implementations/axio...
Author: veithen
Date: Sat Jul 19 22:25:45 2014
New Revision: 1611981
URL: http://svn.apache.org/r1611981
Log:
Move more code to aspects.
Added:
webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java (with props)
webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj (with props)
webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/EmptyNodeList.java
- copied, changed from r1611836, webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EmptyNodeList.java
webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj (with props)
Removed:
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EmptyNodeList.java
Modified:
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/CoreParentNodeSupport.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/DOMParentNode.java
webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNodeSupport.aj
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/EntityReferenceImpl.java
webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/LeafNode.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-impl/src/main/java/org/apache/axiom/om/impl/llom/OMDocumentImpl.java
webservices/axiom/trunk/implementations/dom/src/main/java/org/apache/axiom/dom/impl/LeafNode.java
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -28,4 +28,15 @@ public aspect CoreDocumentSupport {
throw new IllegalArgumentException();
}
}
+
+ public final CoreElement CoreDocument.coreGetDocumentElement() {
+ CoreChildNode child = coreGetFirstChild();
+ while (child != null) {
+ if (child instanceof CoreElement) {
+ return (CoreElement)child;
+ }
+ child = child.coreGetNextSibling();
+ }
+ return null;
+ }
}
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -25,6 +25,7 @@ import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.impl.builder.StAXBuilder;
import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.w3c.dom.Node;
public aspect CoreParentNodeSupport {
CoreChildNode CoreParentNode.firstChild;
@@ -96,6 +97,11 @@ public aspect CoreParentNodeSupport {
return firstChild;
}
+ public final CoreChildNode CoreParentNode.coreGetLastChild() {
+ build();
+ return lastChild;
+ }
+
public final void CoreParentNode.coreAppendChild(CoreChildNode child, boolean fromBuilder) {
CoreParentNode parent = child.coreGetParent();
if (!fromBuilder) {
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -41,6 +41,10 @@ public aspect DOMDocumentSupport {
return null;
}
+ public final Element DOMDocument.getDocumentElement() {
+ return (Element)coreGetDocumentElement();
+ }
+
public final String DOMDocument.lookupNamespaceURI(String specifiedPrefix) {
Element documentElement = getDocumentElement();
return documentElement == null ? null
Added: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java?rev=1611981&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java (added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java Sat Jul 19 22:25:45 2014
@@ -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 DOMLeafNode extends DOMChildNode {
+
+}
Propchange: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNode.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: 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=1611981&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj (added)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj Sat Jul 19 22:25:45 2014
@@ -0,0 +1,59 @@
+/*
+ * 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 static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
+
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public aspect DOMLeafNodeSupport {
+ public final boolean DOMLeafNode.hasChildNodes() {
+ return false;
+ }
+
+ public final Node DOMLeafNode.getFirstChild() {
+ return null;
+ }
+
+ public final Node DOMLeafNode.getLastChild() {
+ return null;
+ }
+
+ public final NodeList DOMLeafNode.getChildNodes() {
+ return EmptyNodeList.INSTANCE;
+ }
+
+ public final Node DOMLeafNode.appendChild(Node newChild) throws DOMException {
+ throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
+ }
+
+ public final Node DOMLeafNode.removeChild(Node oldChild) throws DOMException {
+ throw newDOMException(DOMException.NOT_FOUND_ERR);
+ }
+
+ public final Node DOMLeafNode.insertBefore(Node newChild, Node refChild) throws DOMException {
+ throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
+ }
+
+ public final Node DOMLeafNode.replaceChild(Node newChild, Node oldChild) throws DOMException {
+ throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
+ }
+}
Propchange: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMLeafNodeSupport.aj
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNode.java?rev=1611981&r1=1611980&r2=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNode.java (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNode.java Sat Jul 19 22:25:45 2014
@@ -19,7 +19,8 @@
package org.apache.axiom.dom;
import org.apache.axiom.core.CoreParentNode;
+import org.w3c.dom.NodeList;
-public interface DOMParentNode extends DOMNode, CoreParentNode {
+public interface DOMParentNode extends DOMNode, NodeList, CoreParentNode {
}
Modified: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNodeSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNodeSupport.aj?rev=1611981&r1=1611980&r2=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNodeSupport.aj (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/DOMParentNodeSupport.aj Sat Jul 19 22:25:45 2014
@@ -23,8 +23,49 @@ import static org.apache.axiom.dom.DOMEx
import org.apache.axiom.core.CoreChildNode;
import org.w3c.dom.DOMException;
import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
public aspect DOMParentNodeSupport {
+ public final NodeList DOMParentNode.getChildNodes() {
+ return this;
+ }
+
+ public final int DOMParentNode.getLength() {
+ int count = 0;
+ Node child = getFirstChild();
+ while (child != null) {
+ count++;
+ child = child.getNextSibling();
+ }
+ return count;
+ }
+
+ public final Node DOMParentNode.item(int index) {
+ int count = 0;
+ Node child = getFirstChild();
+ while (child != null) {
+ if (count == index) {
+ return child;
+ } else {
+ child = child.getNextSibling();
+ }
+ count++;
+ }
+ return null;
+ }
+
+ public final Node DOMParentNode.getFirstChild() {
+ return (Node)coreGetFirstChild();
+ }
+
+ public final Node DOMParentNode.getLastChild() {
+ return (Node)coreGetLastChild();
+ }
+
+ public final boolean DOMParentNode.hasChildNodes() {
+ return getFirstChild() != null;
+ }
+
public final Node DOMParentNode.removeChild(Node oldChild) throws DOMException {
if (oldChild.getParentNode() == this) {
((CoreChildNode)oldChild).coreDetach(coreGetOwnerDocument(true));
Copied: webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/EmptyNodeList.java (from r1611836, webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EmptyNodeList.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/EmptyNodeList.java?p2=webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/EmptyNodeList.java&p1=webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EmptyNodeList.java&r1=1611836&r2=1611981&rev=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EmptyNodeList.java (original)
+++ webservices/axiom/trunk/aspects/dom-aspects/src/main/java/org/apache/axiom/dom/EmptyNodeList.java Sat Jul 19 22:25:45 2014
@@ -16,12 +16,12 @@
* specific language governing permissions and limitations
* under the License.
*/
-package org.apache.axiom.om.impl.dom;
+package org.apache.axiom.dom;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
-class EmptyNodeList implements NodeList {
+final class EmptyNodeList implements NodeList {
static final EmptyNodeList INSTANCE = new EmptyNodeList();
private EmptyNodeList() {}
Added: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj?rev=1611981&view=auto
==============================================================================
--- webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj (added)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj Sat Jul 19 22:25:45 2014
@@ -0,0 +1,27 @@
+/*
+ * 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.om.impl.common;
+
+import org.apache.axiom.om.OMElement;
+
+public aspect OMDocumentSupport {
+ public final OMElement IDocument.getOMDocumentElement() {
+ return (OMElement)coreGetDocumentElement();
+ }
+}
Propchange: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/OMDocumentSupport.aj
------------------------------------------------------------------------------
svn:eol-style = native
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -33,7 +33,6 @@ import org.apache.axiom.om.OMOutputForma
import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.dom.DOMMetaFactory;
import org.apache.axiom.om.impl.MTOMXMLStreamWriter;
-import org.apache.axiom.om.impl.OMNodeEx;
import org.apache.axiom.om.impl.common.IDocument;
import org.apache.axiom.om.impl.common.OMDocumentHelper;
import org.apache.axiom.om.impl.common.OMNamespaceImpl;
@@ -397,27 +396,6 @@ public class DocumentImpl extends RootNo
this.xmlEncoding = encoding;
}
- public OMElement getOMDocumentElement() {
- OMNode child = getFirstOMChild();
- while (child != null) {
- if (child instanceof OMElement) {
- return (OMElement)child;
- }
- child = child.getNextOMSibling();
- }
- return null;
- }
-
- /**
- * Returns the document element.
- *
- * @see org.w3c.dom.Document#getDocumentElement()
- */
- public Element getDocumentElement() {
-
- return (Element) this.getOMDocumentElement();
- }
-
protected void addIdAttr(Attr attr) {
if (this.idAttrs == null) {
this.idAttrs = new Vector();
Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java?rev=1611981&r1=1611980&r2=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/EntityReferenceImpl.java Sat Jul 19 22:25:45 2014
@@ -69,6 +69,10 @@ public class EntityReferenceImpl extends
return Node.ENTITY_REFERENCE_NODE;
}
+ public final boolean hasChildNodes() {
+ throw new UnsupportedOperationException();
+ }
+
public Node getFirstChild() {
throw new UnsupportedOperationException();
}
Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/LeafNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/LeafNode.java?rev=1611981&r1=1611980&r2=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/LeafNode.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/LeafNode.java Sat Jul 19 22:25:45 2014
@@ -18,46 +18,15 @@
*/
package org.apache.axiom.om.impl.dom;
-import static org.apache.axiom.dom.DOMExceptionUtil.newDOMException;
-
+import org.apache.axiom.dom.DOMLeafNode;
import org.apache.axiom.om.OMFactory;
import org.w3c.dom.DOMException;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-public abstract class LeafNode extends ChildNode {
+public abstract class LeafNode extends ChildNode implements DOMLeafNode {
public LeafNode(OMFactory factory) {
super(factory);
}
- public final Node getFirstChild() {
- return null;
- }
-
- public final Node getLastChild() {
- return null;
- }
-
- public final NodeList getChildNodes() {
- return EmptyNodeList.INSTANCE;
- }
-
- public final Node appendChild(Node newChild) throws DOMException {
- throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
- }
-
- public final Node removeChild(Node oldChild) throws DOMException {
- throw newDOMException(DOMException.NOT_FOUND_ERR);
- }
-
- public final Node insertBefore(Node newChild, Node refChild) throws DOMException {
- throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
- }
-
- public final Node replaceChild(Node newChild, Node oldChild) throws DOMException {
- throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
- }
-
public final String getTextContent() throws DOMException {
return getNodeValue();
}
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -75,10 +75,6 @@ public abstract class NodeImpl extends I
return false; // overridden in ElementImpl
}
- public boolean hasChildNodes() {
- return false; // Override in ParentNode
- }
-
public String getNamespaceURI() {
return null; // Override in AttrImpl and ElementImpl
}
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -29,9 +29,8 @@ import org.apache.axiom.om.OMSourcedElem
import org.w3c.dom.DOMException;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-public abstract class ParentNode extends NodeImpl implements NodeList, DOMParentNode {
+public abstract class ParentNode extends NodeImpl implements DOMParentNode {
protected ParentNode(OMFactory factory) {
super(factory);
}
@@ -40,49 +39,6 @@ public abstract class ParentNode extends
// /DOM Node methods
// /
- public final NodeList getChildNodes() {
- return this;
- }
-
- public final int getLength() {
- int count = 0;
- Node child = getFirstChild();
- while (child != null) {
- count++;
- child = child.getNextSibling();
- }
- return count;
- }
-
- public final Node item(int index) {
- int count = 0;
- Node child = getFirstChild();
- while (child != null) {
- if (count == index) {
- return child;
- } else {
- child = child.getNextSibling();
- }
- count++;
- }
- return null;
- }
-
- public Node getFirstChild() {
- return (Node)coreGetFirstChild();
- }
-
- public Node getLastChild() {
- if (!this.isComplete()) {
- this.build();
- }
- return (Node)coreGetLastKnownChild();
- }
-
- public boolean hasChildNodes() {
- return getFirstChild() != null;
- }
-
public final Node appendChild(Node newChild) throws DOMException {
return insertBefore(newChild, null);
}
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=1611981&r1=1611980&r2=1611981&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 Sat Jul 19 22:25:45 2014
@@ -68,17 +68,6 @@ public class OMDocumentImpl extends OMSe
coreSetBuilder(parserWrapper);
}
- public OMElement getOMDocumentElement() {
- OMNode child = getFirstOMChild();
- while (child != null) {
- if (child instanceof OMElement) {
- return (OMElement)child;
- }
- child = child.getNextOMSibling();
- }
- return null;
- }
-
public void setOMDocumentElement(OMElement documentElement) {
if (documentElement == null) {
throw new IllegalArgumentException("documentElement must not be null");
Modified: webservices/axiom/trunk/implementations/dom/src/main/java/org/apache/axiom/dom/impl/LeafNode.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/dom/src/main/java/org/apache/axiom/dom/impl/LeafNode.java?rev=1611981&r1=1611980&r2=1611981&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/dom/src/main/java/org/apache/axiom/dom/impl/LeafNode.java (original)
+++ webservices/axiom/trunk/implementations/dom/src/main/java/org/apache/axiom/dom/impl/LeafNode.java Sat Jul 19 22:25:45 2014
@@ -18,6 +18,8 @@
*/
package org.apache.axiom.dom.impl;
-abstract class LeafNode extends NodeImpl {
+import org.apache.axiom.dom.DOMLeafNode;
+
+abstract class LeafNode extends NodeImpl implements DOMLeafNode {
}