Index: xml/AbstractNode.java =================================================================== --- xml/AbstractNode.java (revision 0) +++ xml/AbstractNode.java (revision 0) @@ -0,0 +1,393 @@ +/* + * ======================================================================== + * + * Copyright 2005 Vincent Massol. + * + * Licensed 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.codehaus.cargo.util.xml; + +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.UserDataHandler; + +/** + * Simple wrapped abstract node + * + * @version $Id $ + * + */ +public abstract class AbstractNode implements Node +{ + /** + * The wrapped node + */ + protected Node node; + + /** + * @param node in the node to wrap + */ + protected AbstractNode(Node node) + { + this.node = node; + } + + /** + * @return the underlying unwrapped node + */ + public Node getNode() + { + return this.node; + } + + /** + * @param node in the possibly wrapped node + * @return the underlying unwrapped node + */ + protected Node getNode(Node node) + { + if (node instanceof AbstractNode) + { + return ((AbstractNode) node).getNode(); + } + return node; + } + + /** + * @see org.w3c.dom.Node#getNodeName() + */ + public String getNodeName() + { + return getNode().getNodeName(); + } + + /** + * @see org.w3c.dom.Node#getNodeValue() + */ + public String getNodeValue() throws DOMException + { + return getNode().getNodeValue(); + } + + /** + * @see org.w3c.dom.Node#setNodeValue(java.lang.String) + */ + public void setNodeValue(String nodeValue) throws DOMException + { + getNode().setNodeValue(nodeValue); + } + + /** + * @see org.w3c.dom.Node#getNodeType() + */ + public short getNodeType() + { + return getNode().getNodeType(); + } + + /** + * @see org.w3c.dom.Node#getParentNode() + */ + public Node getParentNode() + { + return getNode().getParentNode(); + } + + /** + * @see org.w3c.dom.Node#getChildNodes() + */ + public NodeList getChildNodes() + { + return getNode().getChildNodes(); + } + + /** + * @see org.w3c.dom.Node#getFirstChild() + */ + public Node getFirstChild() + { + + return getNode().getFirstChild(); + } + + /** + * @see org.w3c.dom.Node#getLastChild() + */ + public Node getLastChild() + { + return getNode().getLastChild(); + } + + /** + * @see org.w3c.dom.Node#getPreviousSibling() + */ + public Node getPreviousSibling() + { + return getNode().getPreviousSibling(); + } + + /** + * @see org.w3c.dom.Node#getNextSibling() + */ + public Node getNextSibling() + { + return getNode().getNextSibling(); + } + + /** + * @see org.w3c.dom.Node#getAttributes() + */ + public NamedNodeMap getAttributes() + { + + return getNode().getAttributes(); + } + + /** + * @see org.w3c.dom.Node#getOwnerDocument() + */ + public Document getOwnerDocument() + { + + return getNode().getOwnerDocument(); + } + + /** + * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node) + */ + public Node insertBefore(Node newChild, Node refChild) throws DOMException + { + + return getNode().insertBefore(getNode(newChild), getNode(refChild)); + } + + /** + * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node) + */ + public Node replaceChild(Node newChild, Node oldChild) throws DOMException + { + + return getNode().replaceChild(getNode(newChild), getNode(oldChild)); + } + + /** + * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node) + */ + public Node removeChild(Node oldChild) throws DOMException + { + return getNode().removeChild(getNode(oldChild)); + } + + /** + * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node) + */ + public Node appendChild(Node newChild) throws DOMException + { + return getNode().appendChild(getNode(newChild)); + } + + /** + * @see org.w3c.dom.Node#hasChildNodes() + */ + public boolean hasChildNodes() + { + + return getNode().hasChildNodes(); + } + + /** + * @see org.w3c.dom.Node#cloneNode(boolean) + */ + public Node cloneNode(boolean deep) + { + + return getNode().cloneNode(deep); + } + + /** + * @see org.w3c.dom.Node#normalize() + */ + public void normalize() + { + getNode().normalize(); + } + + /** + * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String) + */ + public boolean isSupported(String feature, String version) + { + return getNode().isSupported(feature, version); + } + + /** + * @see org.w3c.dom.Node#getNamespaceURI() + */ + public String getNamespaceURI() + { + return getNode().getNamespaceURI(); + } + + /** + * @see org.w3c.dom.Node#getPrefix() + */ + public String getPrefix() + { + return getNode().getPrefix(); + } + + /** + * @see org.w3c.dom.Node#setPrefix(java.lang.String) + */ + public void setPrefix(String prefix) throws DOMException + { + getNode().setPrefix(prefix); + } + + /** + * @see org.w3c.dom.Node#getLocalName() + */ + public String getLocalName() + { + + return getNode().getLocalName(); + } + + /** + * @see org.w3c.dom.Node#hasAttributes() + */ + public boolean hasAttributes() + { + + return getNode().hasAttributes(); + } + + // From here on down are DOM level 3 methods. We have to include them, + // otherwise compiling won't work on JDK1.5. But we can't proxy them, + // because the methods won't be there on JDK1.4. And we can't throw + // NotImplementedException, because the build doesn't like that package.. + + + /** + * @see org.w3c.dom.Node#getBaseURI() + */ + public String getBaseURI() + { + throw new RuntimeException(); + //return getNode().getBaseURI(); + } + + /** + * @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node) + */ + public short compareDocumentPosition(Node other) throws DOMException + { + throw new RuntimeException(); + //return getNode().compareDocumentPosition(getNode(other)); + } + + /** + * @see org.w3c.dom.Node#getTextContent() + */ + public String getTextContent() throws DOMException + { + throw new RuntimeException(); + //return getNode().getTextContent(); + } + + /** + * @see org.w3c.dom.Node#setTextContent(java.lang.String) + */ + public void setTextContent(String textContent) throws DOMException + { + throw new RuntimeException(); + //getNode().setTextContent(textContent); + } + + /** + * @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node) + */ + public boolean isSameNode(Node other) + { + throw new RuntimeException(); + //return getNode().isSameNode(getNode(other)); + } + + /** + * @see org.w3c.dom.Node#lookupPrefix(java.lang.String) + */ + public String lookupPrefix(String namespaceURI) + { + throw new RuntimeException(); + //return getNode().lookupPrefix(namespaceURI); + } + + /** + * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) + */ + public boolean isDefaultNamespace(String namespaceURI) + { + throw new RuntimeException(); + //return getNode().isDefaultNamespace(namespaceURI); + } + + /** + * @see org.w3c.dom.Node#lookupNamespaceURI(java.lang.String) + */ + public String lookupNamespaceURI(String prefix) + { + throw new RuntimeException(); + //return getNode().lookupNamespaceURI(prefix); + } + + /** + * @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node) + */ + public boolean isEqualNode(Node arg) + { + throw new RuntimeException(); + //return getNode().isEqualNode(getNode(arg)); + } + + /** + * @see org.w3c.dom.Node#getFeature(java.lang.String, java.lang.String) + */ + public Object getFeature(String feature, String version) + { + throw new RuntimeException(); + //return getNode().getFeature(feature, version); + } + + /** + * @see org.w3c.dom.Node#setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler) + */ + public Object setUserData(String key, Object data, UserDataHandler handler) + { + throw new RuntimeException(); + //return getNode().setUserData(key, data, handler); + } + + /** + * @see org.w3c.dom.Node#getUserData(java.lang.String) + */ + public Object getUserData(String key) + { + throw new RuntimeException(); + //return getNode().getUserData(key); + } +} Index: xml/AbstractElement.java =================================================================== --- xml/AbstractElement.java (revision 0) +++ xml/AbstractElement.java (revision 0) @@ -0,0 +1,267 @@ +/* + * ======================================================================== + * + * Copyright 2005 Vincent Massol. + * + * Licensed 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.codehaus.cargo.util.xml; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.TypeInfo; + +/** + * Simple wrapped abstract element so that subclasses can bind to particular + * attributes + * + * @version $Id $ + * + */ + +public abstract class AbstractElement extends AbstractNode implements Element +{ + + /** + * Constructor + * + * @param element in element to wrap + */ + protected AbstractElement(Element element) + { + super(element); + } + + /** + * @return the wrapped element + */ + public Element getElement() + { + return (Element) getNode(); + } + + /** + * Overridden by concrete implementors to return some reasonable identifier for + * this section of XML + * + * @return the identifier of this section + */ + public abstract String getElementId(); + + /** + * Returns the text value of an element + * + * @param element the element of wich the text value should be returned + * + * @return the text value of an element + */ + protected String getText(Element element) + { + String text = null; + Node nestedText = element.getFirstChild(); + if (nestedText != null) + { + text = nestedText.getNodeValue(); + } + return text; + } + + /** + * @see org.w3c.dom.Element#getTagName() + */ + public String getTagName() + { + return getElement().getTagName(); + } + + /** + * @see org.w3c.dom.Element#getAttribute(java.lang.String) + */ + public String getAttribute(String name) + { + return getElement().getAttribute(name); + } + + /** + * @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String) + */ + public void setAttribute(String name, String value) throws DOMException + { + getElement().setAttribute(name, value); + } + + /** + * @see org.w3c.dom.Element#removeAttribute(java.lang.String) + */ + public void removeAttribute(String name) throws DOMException + { + getElement().removeAttribute(name); + } + + /** + * @see org.w3c.dom.Element#getAttributeNode(java.lang.String) + */ + public Attr getAttributeNode(String name) + { + return getElement().getAttributeNode(name); + } + + /** + * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr) + */ + public Attr setAttributeNode(Attr newAttr) throws DOMException + { + return getElement().setAttributeNode(newAttr); + } + + /** + * @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr) + */ + public Attr removeAttributeNode(Attr oldAttr) throws DOMException + { + return getElement().removeAttributeNode(oldAttr); + } + + /** + * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String) + */ + /** + * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String) + */ + public NodeList getElementsByTagName(String name) + { + + return getElement().getElementsByTagName(name); + } + + /** + * @see org.w3c.dom.Element#getAttributeNS(java.lang.String, java.lang.String) + */ + public String getAttributeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().getAttributeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#setAttributeNS(java.lang.String, java.lang.String, java.lang.String) + */ + public void setAttributeNS(String namespaceURI, String qualifiedName, String value) + throws DOMException + { + + getElement().setAttributeNS(namespaceURI, qualifiedName, value); + } + + /** + * @see org.w3c.dom.Element#removeAttributeNS(java.lang.String, java.lang.String) + */ + public void removeAttributeNS(String namespaceURI, String localName) throws DOMException + { + + getElement().removeAttributeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#getAttributeNodeNS(java.lang.String, java.lang.String) + */ + public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().getAttributeNodeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr) + */ + public Attr setAttributeNodeNS(Attr newAttr) throws DOMException + { + + return getElement().setAttributeNodeNS(newAttr); + } + + /** + * @see org.w3c.dom.Element#getElementsByTagNameNS(java.lang.String, java.lang.String) + */ + public NodeList getElementsByTagNameNS(String namespaceURI, String localName) + throws DOMException + { + + return getElement().getElementsByTagNameNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#hasAttribute(java.lang.String) + */ + public boolean hasAttribute(String name) + { + + return getElement().hasAttribute(name); + } + + /** + * @see org.w3c.dom.Element#hasAttributeNS(java.lang.String, java.lang.String) + */ + public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().hasAttributeNS(namespaceURI, localName); + } + + // From here on down are DOM level 3 methods. We have to include them, + // otherwise compiling won't work on JDK1.5. But we can't proxy them, + // because the methods won't be there on JDK1.4. And we can't throw + // NotImplementedException, because the build doesn't like that package.. + + /** + * @see org.w3c.dom.Element#getSchemaTypeInfo() + */ + public TypeInfo getSchemaTypeInfo() + { + throw new RuntimeException(); + //return getElement().getSchemaTypeInfo(); + } + + /** + * @see org.w3c.dom.Element#setIdAttribute(java.lang.String, boolean) + */ + public void setIdAttribute(String name, boolean isId) throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttribute(name, isId); + } + + /** + * @see org.w3c.dom.Element#setIdAttributeNS(java.lang.String, java.lang.String, boolean) + */ + public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) + throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttributeNS(namespaceURI, localName, isId); + } + + /** + * @see org.w3c.dom.Element#setIdAttributeNode(org.w3c.dom.Attr, boolean) + */ + public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttributeNode(idAttr, isId); + } +} Index: xml/AbstractElement.java =================================================================== --- xml/AbstractElement.java (revision 0) +++ xml/AbstractElement.java (revision 0) @@ -0,0 +1,267 @@ +/* + * ======================================================================== + * + * Copyright 2005 Vincent Massol. + * + * Licensed 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.codehaus.cargo.util.xml; + +import org.w3c.dom.Attr; +import org.w3c.dom.DOMException; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.TypeInfo; + +/** + * Simple wrapped abstract element so that subclasses can bind to particular + * attributes + * + * @version $Id $ + * + */ + +public abstract class AbstractElement extends AbstractNode implements Element +{ + + /** + * Constructor + * + * @param element in element to wrap + */ + protected AbstractElement(Element element) + { + super(element); + } + + /** + * @return the wrapped element + */ + public Element getElement() + { + return (Element) getNode(); + } + + /** + * Overridden by concrete implementors to return some reasonable identifier for + * this section of XML + * + * @return the identifier of this section + */ + public abstract String getElementId(); + + /** + * Returns the text value of an element + * + * @param element the element of wich the text value should be returned + * + * @return the text value of an element + */ + protected String getText(Element element) + { + String text = null; + Node nestedText = element.getFirstChild(); + if (nestedText != null) + { + text = nestedText.getNodeValue(); + } + return text; + } + + /** + * @see org.w3c.dom.Element#getTagName() + */ + public String getTagName() + { + return getElement().getTagName(); + } + + /** + * @see org.w3c.dom.Element#getAttribute(java.lang.String) + */ + public String getAttribute(String name) + { + return getElement().getAttribute(name); + } + + /** + * @see org.w3c.dom.Element#setAttribute(java.lang.String, java.lang.String) + */ + public void setAttribute(String name, String value) throws DOMException + { + getElement().setAttribute(name, value); + } + + /** + * @see org.w3c.dom.Element#removeAttribute(java.lang.String) + */ + public void removeAttribute(String name) throws DOMException + { + getElement().removeAttribute(name); + } + + /** + * @see org.w3c.dom.Element#getAttributeNode(java.lang.String) + */ + public Attr getAttributeNode(String name) + { + return getElement().getAttributeNode(name); + } + + /** + * @see org.w3c.dom.Element#setAttributeNode(org.w3c.dom.Attr) + */ + public Attr setAttributeNode(Attr newAttr) throws DOMException + { + return getElement().setAttributeNode(newAttr); + } + + /** + * @see org.w3c.dom.Element#removeAttributeNode(org.w3c.dom.Attr) + */ + public Attr removeAttributeNode(Attr oldAttr) throws DOMException + { + return getElement().removeAttributeNode(oldAttr); + } + + /** + * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String) + */ + /** + * @see org.w3c.dom.Element#getElementsByTagName(java.lang.String) + */ + public NodeList getElementsByTagName(String name) + { + + return getElement().getElementsByTagName(name); + } + + /** + * @see org.w3c.dom.Element#getAttributeNS(java.lang.String, java.lang.String) + */ + public String getAttributeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().getAttributeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#setAttributeNS(java.lang.String, java.lang.String, java.lang.String) + */ + public void setAttributeNS(String namespaceURI, String qualifiedName, String value) + throws DOMException + { + + getElement().setAttributeNS(namespaceURI, qualifiedName, value); + } + + /** + * @see org.w3c.dom.Element#removeAttributeNS(java.lang.String, java.lang.String) + */ + public void removeAttributeNS(String namespaceURI, String localName) throws DOMException + { + + getElement().removeAttributeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#getAttributeNodeNS(java.lang.String, java.lang.String) + */ + public Attr getAttributeNodeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().getAttributeNodeNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#setAttributeNodeNS(org.w3c.dom.Attr) + */ + public Attr setAttributeNodeNS(Attr newAttr) throws DOMException + { + + return getElement().setAttributeNodeNS(newAttr); + } + + /** + * @see org.w3c.dom.Element#getElementsByTagNameNS(java.lang.String, java.lang.String) + */ + public NodeList getElementsByTagNameNS(String namespaceURI, String localName) + throws DOMException + { + + return getElement().getElementsByTagNameNS(namespaceURI, localName); + } + + /** + * @see org.w3c.dom.Element#hasAttribute(java.lang.String) + */ + public boolean hasAttribute(String name) + { + + return getElement().hasAttribute(name); + } + + /** + * @see org.w3c.dom.Element#hasAttributeNS(java.lang.String, java.lang.String) + */ + public boolean hasAttributeNS(String namespaceURI, String localName) throws DOMException + { + + return getElement().hasAttributeNS(namespaceURI, localName); + } + + // From here on down are DOM level 3 methods. We have to include them, + // otherwise compiling won't work on JDK1.5. But we can't proxy them, + // because the methods won't be there on JDK1.4. And we can't throw + // NotImplementedException, because the build doesn't like that package.. + + /** + * @see org.w3c.dom.Element#getSchemaTypeInfo() + */ + public TypeInfo getSchemaTypeInfo() + { + throw new RuntimeException(); + //return getElement().getSchemaTypeInfo(); + } + + /** + * @see org.w3c.dom.Element#setIdAttribute(java.lang.String, boolean) + */ + public void setIdAttribute(String name, boolean isId) throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttribute(name, isId); + } + + /** + * @see org.w3c.dom.Element#setIdAttributeNS(java.lang.String, java.lang.String, boolean) + */ + public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) + throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttributeNS(namespaceURI, localName, isId); + } + + /** + * @see org.w3c.dom.Element#setIdAttributeNode(org.w3c.dom.Attr, boolean) + */ + public void setIdAttributeNode(Attr idAttr, boolean isId) throws DOMException + { + throw new RuntimeException(); + //getElement().setIdAttributeNode(idAttr, isId); + } +} Index: xml/AbstractNode.java =================================================================== --- xml/AbstractNode.java (revision 0) +++ xml/AbstractNode.java (revision 0) @@ -0,0 +1,393 @@ +/* + * ======================================================================== + * + * Copyright 2005 Vincent Massol. + * + * Licensed 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.codehaus.cargo.util.xml; + +import org.w3c.dom.DOMException; +import org.w3c.dom.Document; +import org.w3c.dom.NamedNodeMap; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; +import org.w3c.dom.UserDataHandler; + +/** + * Simple wrapped abstract node + * + * @version $Id $ + * + */ +public abstract class AbstractNode implements Node +{ + /** + * The wrapped node + */ + protected Node node; + + /** + * @param node in the node to wrap + */ + protected AbstractNode(Node node) + { + this.node = node; + } + + /** + * @return the underlying unwrapped node + */ + public Node getNode() + { + return this.node; + } + + /** + * @param node in the possibly wrapped node + * @return the underlying unwrapped node + */ + protected Node getNode(Node node) + { + if (node instanceof AbstractNode) + { + return ((AbstractNode) node).getNode(); + } + return node; + } + + /** + * @see org.w3c.dom.Node#getNodeName() + */ + public String getNodeName() + { + return getNode().getNodeName(); + } + + /** + * @see org.w3c.dom.Node#getNodeValue() + */ + public String getNodeValue() throws DOMException + { + return getNode().getNodeValue(); + } + + /** + * @see org.w3c.dom.Node#setNodeValue(java.lang.String) + */ + public void setNodeValue(String nodeValue) throws DOMException + { + getNode().setNodeValue(nodeValue); + } + + /** + * @see org.w3c.dom.Node#getNodeType() + */ + public short getNodeType() + { + return getNode().getNodeType(); + } + + /** + * @see org.w3c.dom.Node#getParentNode() + */ + public Node getParentNode() + { + return getNode().getParentNode(); + } + + /** + * @see org.w3c.dom.Node#getChildNodes() + */ + public NodeList getChildNodes() + { + return getNode().getChildNodes(); + } + + /** + * @see org.w3c.dom.Node#getFirstChild() + */ + public Node getFirstChild() + { + + return getNode().getFirstChild(); + } + + /** + * @see org.w3c.dom.Node#getLastChild() + */ + public Node getLastChild() + { + return getNode().getLastChild(); + } + + /** + * @see org.w3c.dom.Node#getPreviousSibling() + */ + public Node getPreviousSibling() + { + return getNode().getPreviousSibling(); + } + + /** + * @see org.w3c.dom.Node#getNextSibling() + */ + public Node getNextSibling() + { + return getNode().getNextSibling(); + } + + /** + * @see org.w3c.dom.Node#getAttributes() + */ + public NamedNodeMap getAttributes() + { + + return getNode().getAttributes(); + } + + /** + * @see org.w3c.dom.Node#getOwnerDocument() + */ + public Document getOwnerDocument() + { + + return getNode().getOwnerDocument(); + } + + /** + * @see org.w3c.dom.Node#insertBefore(org.w3c.dom.Node, org.w3c.dom.Node) + */ + public Node insertBefore(Node newChild, Node refChild) throws DOMException + { + + return getNode().insertBefore(getNode(newChild), getNode(refChild)); + } + + /** + * @see org.w3c.dom.Node#replaceChild(org.w3c.dom.Node, org.w3c.dom.Node) + */ + public Node replaceChild(Node newChild, Node oldChild) throws DOMException + { + + return getNode().replaceChild(getNode(newChild), getNode(oldChild)); + } + + /** + * @see org.w3c.dom.Node#removeChild(org.w3c.dom.Node) + */ + public Node removeChild(Node oldChild) throws DOMException + { + return getNode().removeChild(getNode(oldChild)); + } + + /** + * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node) + */ + public Node appendChild(Node newChild) throws DOMException + { + return getNode().appendChild(getNode(newChild)); + } + + /** + * @see org.w3c.dom.Node#hasChildNodes() + */ + public boolean hasChildNodes() + { + + return getNode().hasChildNodes(); + } + + /** + * @see org.w3c.dom.Node#cloneNode(boolean) + */ + public Node cloneNode(boolean deep) + { + + return getNode().cloneNode(deep); + } + + /** + * @see org.w3c.dom.Node#normalize() + */ + public void normalize() + { + getNode().normalize(); + } + + /** + * @see org.w3c.dom.Node#isSupported(java.lang.String, java.lang.String) + */ + public boolean isSupported(String feature, String version) + { + return getNode().isSupported(feature, version); + } + + /** + * @see org.w3c.dom.Node#getNamespaceURI() + */ + public String getNamespaceURI() + { + return getNode().getNamespaceURI(); + } + + /** + * @see org.w3c.dom.Node#getPrefix() + */ + public String getPrefix() + { + return getNode().getPrefix(); + } + + /** + * @see org.w3c.dom.Node#setPrefix(java.lang.String) + */ + public void setPrefix(String prefix) throws DOMException + { + getNode().setPrefix(prefix); + } + + /** + * @see org.w3c.dom.Node#getLocalName() + */ + public String getLocalName() + { + + return getNode().getLocalName(); + } + + /** + * @see org.w3c.dom.Node#hasAttributes() + */ + public boolean hasAttributes() + { + + return getNode().hasAttributes(); + } + + // From here on down are DOM level 3 methods. We have to include them, + // otherwise compiling won't work on JDK1.5. But we can't proxy them, + // because the methods won't be there on JDK1.4. And we can't throw + // NotImplementedException, because the build doesn't like that package.. + + + /** + * @see org.w3c.dom.Node#getBaseURI() + */ + public String getBaseURI() + { + throw new RuntimeException(); + //return getNode().getBaseURI(); + } + + /** + * @see org.w3c.dom.Node#compareDocumentPosition(org.w3c.dom.Node) + */ + public short compareDocumentPosition(Node other) throws DOMException + { + throw new RuntimeException(); + //return getNode().compareDocumentPosition(getNode(other)); + } + + /** + * @see org.w3c.dom.Node#getTextContent() + */ + public String getTextContent() throws DOMException + { + throw new RuntimeException(); + //return getNode().getTextContent(); + } + + /** + * @see org.w3c.dom.Node#setTextContent(java.lang.String) + */ + public void setTextContent(String textContent) throws DOMException + { + throw new RuntimeException(); + //getNode().setTextContent(textContent); + } + + /** + * @see org.w3c.dom.Node#isSameNode(org.w3c.dom.Node) + */ + public boolean isSameNode(Node other) + { + throw new RuntimeException(); + //return getNode().isSameNode(getNode(other)); + } + + /** + * @see org.w3c.dom.Node#lookupPrefix(java.lang.String) + */ + public String lookupPrefix(String namespaceURI) + { + throw new RuntimeException(); + //return getNode().lookupPrefix(namespaceURI); + } + + /** + * @see org.w3c.dom.Node#isDefaultNamespace(java.lang.String) + */ + public boolean isDefaultNamespace(String namespaceURI) + { + throw new RuntimeException(); + //return getNode().isDefaultNamespace(namespaceURI); + } + + /** + * @see org.w3c.dom.Node#lookupNamespaceURI(java.lang.String) + */ + public String lookupNamespaceURI(String prefix) + { + throw new RuntimeException(); + //return getNode().lookupNamespaceURI(prefix); + } + + /** + * @see org.w3c.dom.Node#isEqualNode(org.w3c.dom.Node) + */ + public boolean isEqualNode(Node arg) + { + throw new RuntimeException(); + //return getNode().isEqualNode(getNode(arg)); + } + + /** + * @see org.w3c.dom.Node#getFeature(java.lang.String, java.lang.String) + */ + public Object getFeature(String feature, String version) + { + throw new RuntimeException(); + //return getNode().getFeature(feature, version); + } + + /** + * @see org.w3c.dom.Node#setUserData(java.lang.String, java.lang.Object, org.w3c.dom.UserDataHandler) + */ + public Object setUserData(String key, Object data, UserDataHandler handler) + { + throw new RuntimeException(); + //return getNode().setUserData(key, data, handler); + } + + /** + * @see org.w3c.dom.Node#getUserData(java.lang.String) + */ + public Object getUserData(String key) + { + throw new RuntimeException(); + //return getNode().getUserData(key); + } +}