jaxp/src/com/sun/org/apache/xml/internal/dtm/ref/DTMNodeProxy.java

Print this page

        

*** 25,34 **** --- 25,35 ---- import java.util.Vector; import com.sun.org.apache.xml.internal.dtm.DTM; import com.sun.org.apache.xml.internal.dtm.DTMDOMException; import com.sun.org.apache.xpath.internal.NodeSet; + import java.util.Objects; import org.w3c.dom.Attr; import org.w3c.dom.CDATASection; import org.w3c.dom.Comment; import org.w3c.dom.DOMException;
*** 139,163 **** * * @param node A DTM node proxy reference. * * @return true if the given node has the same handle as this node. */ public final boolean equals(Object node) { - - try - { - // DTMNodeProxy dtmp = (DTMNodeProxy)node; // return (dtmp.node == this.node); // Patch attributed to Gary L Peskin <garyp@firstech.com> ! return equals((Node) node); ! } ! catch (ClassCastException cce) ! { ! return false; } } /** * FUTURE DOM: Test node identity, in lieu of Node==Node * --- 140,164 ---- * * @param node A DTM node proxy reference. * * @return true if the given node has the same handle as this node. */ + @Override public final boolean equals(Object node) { // DTMNodeProxy dtmp = (DTMNodeProxy)node; // return (dtmp.node == this.node); // Patch attributed to Gary L Peskin <garyp@firstech.com> ! return node instanceof Node && equals((Node) node); } + + @Override + public int hashCode() { + int hash = 7; + hash = 29 * hash + Objects.hashCode(this.dtm); + hash = 29 * hash + this.node; + return hash; } /** * FUTURE DOM: Test node identity, in lieu of Node==Node *
*** 179,188 **** --- 180,190 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final String getNodeName() { return dtm.getNodeName(node); }
*** 197,225 **** --- 199,230 ---- * <p> * Note that getNodeName is aliased to getTarget. * * */ + @Override public final String getTarget() { return dtm.getNodeName(node); } // getTarget():String /** * * * @see org.w3c.dom.Node as of DOM Level 2 */ + @Override public final String getLocalName() { return dtm.getLocalName(node); } /** * @return The prefix for this node. * @see org.w3c.dom.Node as of DOM Level 2 */ + @Override public final String getPrefix() { return dtm.getPrefix(node); }
*** 228,247 **** --- 233,254 ---- * @param prefix * * @throws DOMException * @see org.w3c.dom.Node as of DOM Level 2 -- DTMNodeProxy is read-only */ + @Override public final void setPrefix(String prefix) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } /** * * * @see org.w3c.dom.Node as of DOM Level 2 */ + @Override public final String getNamespaceURI() { return dtm.getNamespaceURI(node); }
*** 275,284 **** --- 282,292 ---- * @param version * * @return false * @see org.w3c.dom.Node as of DOM Level 2 */ + @Override public final boolean isSupported(String feature, String version) { return implementation.hasFeature(feature,version); // throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 288,297 **** --- 296,306 ---- * * * @throws DOMException * @see org.w3c.dom.Node */ + @Override public final String getNodeValue() throws DOMException { return dtm.getNodeValue(node); }
*** 310,339 **** --- 319,351 ---- * @param nodeValue * * @throws DOMException * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final void setNodeValue(String nodeValue) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } /** * * * @see org.w3c.dom.Node */ + @Override public final short getNodeType() { return (short) dtm.getNodeType(node); } /** * * * @see org.w3c.dom.Node */ + @Override public final Node getParentNode() { if (getNodeType() == Node.ATTRIBUTE_NODE) return null;
*** 359,368 **** --- 371,381 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final NodeList getChildNodes() { // Annoyingly, AxisIterators do not currently implement DTMIterator, so // we can't just wap DTMNodeList around an Axis.CHILD iterator.
*** 375,384 **** --- 388,398 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final Node getFirstChild() { int newnode = dtm.getFirstChild(node);
*** 388,397 **** --- 402,412 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final Node getLastChild() { int newnode = dtm.getLastChild(node);
*** 401,410 **** --- 416,426 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final Node getPreviousSibling() { int newnode = dtm.getPreviousSibling(node);
*** 414,423 **** --- 430,440 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final Node getNextSibling() { // Attr's Next is defined at DTM level, but not at DOM level. if (dtm.getNodeType(node) == Node.ATTRIBUTE_NODE)
*** 433,442 **** --- 450,460 ---- /** * * * @see org.w3c.dom.Node */ + @Override public final NamedNodeMap getAttributes() { return new DTMNamedNodeMap(dtm, node); }
*** 446,455 **** --- 464,474 ---- * * * @param name * */ + @Override public boolean hasAttribute(String name) { return DTM.NULL != dtm.getAttributeNode(node,null,name); }
*** 460,479 **** --- 479,500 ---- * @param namespaceURI * @param localName * * */ + @Override public boolean hasAttributeNS(String namespaceURI, String localName) { return DTM.NULL != dtm.getAttributeNode(node,namespaceURI,localName); } /** * * * @see org.w3c.dom.Node */ + @Override public final Document getOwnerDocument() { // Note that this uses the DOM-compatable version of the call return (Document)(dtm.getNode(dtm.getOwnerDocument(node))); }
*** 486,495 **** --- 507,517 ---- * * * @throws DOMException * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final Node insertBefore(Node newChild, Node refChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
*** 502,511 **** --- 524,534 ---- * * * @throws DOMException * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final Node replaceChild(Node newChild, Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
*** 517,526 **** --- 540,550 ---- * * * @throws DOMException * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final Node removeChild(Node oldChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
*** 531,550 **** --- 555,576 ---- * * * @throws DOMException * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final Node appendChild(Node newChild) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } /** * * * @see org.w3c.dom.Node */ + @Override public final boolean hasChildNodes() { return (DTM.NULL != dtm.getFirstChild(node)); }
*** 553,582 **** --- 579,611 ---- * @param deep * * * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ + @Override public final Node cloneNode(boolean deep) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * * @see org.w3c.dom.Document */ + @Override public final DocumentType getDoctype() { return null; } /** * * * @see org.w3c.dom.Document */ + @Override public final DOMImplementation getImplementation() { return implementation; }
*** 585,594 **** --- 614,624 ---- * make it work in the well-formed cases but would that be confusing for others? * * * @see org.w3c.dom.Document */ + @Override public final Element getDocumentElement() { int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle);
*** 632,651 **** --- 662,683 ---- * * * @throws DOMException * @see org.w3c.dom.Document */ + @Override public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * * @see org.w3c.dom.Document */ + @Override public final DocumentFragment createDocumentFragment() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 654,663 **** --- 686,696 ---- * @param data * * * @see org.w3c.dom.Document */ + @Override public final Text createTextNode(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 666,675 **** --- 699,709 ---- * @param data * * * @see org.w3c.dom.Document */ + @Override public final Comment createComment(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 680,689 **** --- 714,724 ---- * * * @throws DOMException * @see org.w3c.dom.Document */ + @Override public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 696,705 **** --- 731,741 ---- * * * @throws DOMException * @see org.w3c.dom.Document */ + @Override public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 711,720 **** --- 747,757 ---- * * * @throws DOMException * @see org.w3c.dom.Document */ + @Override public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 725,734 **** --- 762,772 ---- * * * @throws DOMException * @see org.w3c.dom.Document */ + @Override public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 737,746 **** --- 775,785 ---- * @param tagname * * * @see org.w3c.dom.Document */ + @Override public final NodeList getElementsByTagName(String tagname) { Vector listVector = new Vector(); Node retNode = dtm.getNode(node); if (retNode != null)
*** 817,826 **** --- 856,866 ---- * * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only */ + @Override public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); }
*** 833,842 **** --- 873,883 ---- * * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 */ + @Override public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 849,858 **** --- 890,900 ---- * * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 */ + @Override public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 863,872 **** --- 905,915 ---- * @param localName * * * @see org.w3c.dom.Document as of DOM Level 2 */ + @Override public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) { Vector listVector = new Vector(); Node retNode = dtm.getNode(node);
*** 950,959 **** --- 993,1003 ---- * @param elementId * * * @see org.w3c.dom.Document as of DOM Level 2 */ + @Override public final Element getElementById(String elementId) { return (Element) dtm.getNode(dtm.getElementById(elementId)); }
*** 964,973 **** --- 1008,1018 ---- * * * @throws DOMException * @see org.w3c.dom.Text */ + @Override public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 976,985 **** --- 1021,1031 ---- * * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final String getData() throws DOMException { return dtm.getNodeValue(node); }
*** 988,1007 **** --- 1034,1055 ---- * @param data * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final void setData(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * * @see org.w3c.dom.CharacterData */ + @Override public final int getLength() { // %OPT% This should do something smarter? return dtm.getNodeValue(node).length(); }
*** 1014,1023 **** --- 1062,1072 ---- * * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final String substringData(int offset, int count) throws DOMException { return getData().substring(offset,offset+count); }
*** 1026,1035 **** --- 1075,1085 ---- * @param arg * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final void appendData(String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1039,1048 **** --- 1089,1099 ---- * @param arg * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final void insertData(int offset, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1052,1061 **** --- 1103,1113 ---- * @param count * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final void deleteData(int offset, int count) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1066,1075 **** --- 1118,1128 ---- * @param arg * * @throws DOMException * @see org.w3c.dom.CharacterData */ + @Override public final void replaceData(int offset, int count, String arg) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1077,1086 **** --- 1130,1140 ---- /** * * * @see org.w3c.dom.Element */ + @Override public final String getTagName() { return dtm.getNodeName(node); }
*** 1089,1113 **** * @param name * * * @see org.w3c.dom.Element */ public final String getAttribute(String name) { - DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); ! Node node = map.getNamedItem(name); ! return (null == node) ? EMPTYSTRING : node.getNodeValue(); } /** * * @param name * @param value * * @throws DOMException * @see org.w3c.dom.Element */ public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } --- 1143,1169 ---- * @param name * * * @see org.w3c.dom.Element */ + @Override public final String getAttribute(String name) { DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); ! Node n = map.getNamedItem(name); ! return (null == n) ? EMPTYSTRING : n.getNodeValue(); ! } /** * * @param name * @param value * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final void setAttribute(String name, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1117,1126 **** --- 1173,1183 ---- * @param name * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final void removeAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1129,1141 **** * @param name * * * @see org.w3c.dom.Element */ public final Attr getAttributeNode(String name) { - DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); return (Attr)map.getNamedItem(name); } /** --- 1186,1198 ---- * @param name * * * @see org.w3c.dom.Element */ + @Override public final Attr getAttributeNode(String name) { DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); return (Attr)map.getNamedItem(name); } /**
*** 1145,1154 **** --- 1202,1212 ---- * * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1159,1184 **** --- 1217,1245 ---- * * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final Attr removeAttributeNode(Attr oldAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * Introduced in DOM Level 2. * * */ + @Override public boolean hasAttributes() { return DTM.NULL != dtm.getFirstAttribute(node); } /** @see org.w3c.dom.Element */ + @Override public final void normalize() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1188,1197 **** --- 1249,1259 ---- * @param localName * * * @see org.w3c.dom.Element */ + @Override public final String getAttributeNS(String namespaceURI, String localName) { Node retNode = null; int n = dtm.getAttributeNode(node,namespaceURI,localName); if(n != DTM.NULL)
*** 1206,1215 **** --- 1268,1278 ---- * @param value * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final void setAttributeNS( String namespaceURI, String qualifiedName, String value) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);
*** 1221,1230 **** --- 1284,1294 ---- * @param localName * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final void removeAttributeNS(String namespaceURI, String localName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1235,1244 **** --- 1299,1309 ---- * @param localName * * * @see org.w3c.dom.Element */ + @Override public final Attr getAttributeNodeNS(String namespaceURI, String localName) { Attr retAttr = null; int n = dtm.getAttributeNode(node,namespaceURI,localName); if(n != DTM.NULL)
*** 1254,1283 **** --- 1319,1351 ---- * * * @throws DOMException * @see org.w3c.dom.Element */ + @Override public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * * @see org.w3c.dom.Attr */ + @Override public final String getName() { return dtm.getNodeName(node); } /** * * * @see org.w3c.dom.Attr */ + @Override public final boolean getSpecified() { // We really don't know which attributes might have come from the // source document versus from the DTD. Treat them all as having // been provided by the user.
*** 1288,1307 **** --- 1356,1377 ---- /** * * * @see org.w3c.dom.Attr */ + @Override public final String getValue() { return dtm.getNodeValue(node); } /** * * @param value * @see org.w3c.dom.Attr */ + @Override public final void setValue(String value) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1309,1318 **** --- 1379,1389 ---- * Get the owner element of an attribute. * * * @see org.w3c.dom.Attr as of DOM Level 2 */ + @Override public final Element getOwnerElement() { if (getNodeType() != Node.ATTRIBUTE_NODE) return null; // In XPath and DTM data models, unlike DOM, an Attr's parent is its
*** 1329,1341 **** * * NEEDSDOC (adoptNode) @return * * @throws DOMException */ public Node adoptNode(Node source) throws DOMException { - throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a --- 1400,1412 ---- * * NEEDSDOC (adoptNode) @return * * @throws DOMException */ + @Override public Node adoptNode(Node source) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a
*** 1346,1358 **** * of this document. This is <code>null</code> when unspecified. * @since DOM Level 3 * * NEEDSDOC ($objectName$) @return */ public String getInputEncoding() { - throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a --- 1417,1429 ---- * of this document. This is <code>null</code> when unspecified. * @since DOM Level 3 * * NEEDSDOC ($objectName$) @return */ + @Override public String getInputEncoding() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a
*** 1381,1391 **** * * NEEDSDOC ($objectName$) @return */ public boolean getStandalone() { - throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a --- 1452,1461 ----
*** 1416,1428 **** * defaults. * @since DOM Level 3 * * NEEDSDOC ($objectName$) @return */ public boolean getStrictErrorChecking() { - throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a --- 1486,1498 ---- * defaults. * @since DOM Level 3 * * NEEDSDOC ($objectName$) @return */ + @Override public boolean getStrictErrorChecking() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a
*** 1437,1446 **** --- 1507,1517 ---- * defaults. * @since DOM Level 3 * * NEEDSDOC @param strictErrorChecking */ + @Override public void setStrictErrorChecking(boolean strictErrorChecking) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1455,1465 **** * * NEEDSDOC ($objectName$) @return */ public String getVersion() { - throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * <p>EXPERIMENTAL! Based on the <a --- 1526,1535 ----
*** 1480,1493 **** --- 1550,1565 ---- /** Inner class to support getDOMImplementation. */ static class DTMNodeProxyImplementation implements DOMImplementation { + @Override public DocumentType createDocumentType(String qualifiedName,String publicId, String systemId) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } + @Override public Document createDocument(String namespaceURI,String qualfiedName,DocumentType doctype) { // Could create a DTM... but why, when it'd have to be permanantly empty? throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); }
*** 1498,1507 **** --- 1570,1580 ---- * On the other hand, it may be more practically useful to return * true and simply treat the whole DOM as read-only, failing on the * methods we can't support. I'm not sure which would be more useful * to the caller. */ + @Override public boolean hasFeature(String feature,String version) { if( ("CORE".equals(feature.toUpperCase()) || "XML".equals(feature.toUpperCase())) && ("1.0".equals(version) || "2.0".equals(version)))
*** 1528,1537 **** --- 1601,1611 ---- * primary core <code>Node</code> and not return results inconsistent * with the primary core <code>Node</code> such as attributes, * childNodes, etc. * @since DOM Level 3 */ + @Override public Object getFeature(String feature, String version) { // we don't have any alternate node, either this node does the job // or we don't have anything that does //return hasFeature(feature, version) ? this : null; return null; //PENDING
*** 1540,1549 **** --- 1614,1624 ---- } //RAMESH : Pending proper implementation of DOM Level 3 + @Override public Object setUserData(String key, Object data, UserDataHandler handler) { return getOwnerDocument().setUserData( key, data, handler); }
*** 1555,1564 **** --- 1630,1640 ---- * @param key The key the object is associated to. * @return Returns the <code>DOMObject</code> associated to the given key * on this node, or <code>null</code> if there was none. * @since DOM Level 3 */ + @Override public Object getUserData(String key) { return getOwnerDocument().getUserData( key); } /**
*** 1579,1588 **** --- 1655,1665 ---- * primary core <code>Node</code> and not return results inconsistent * with the primary core <code>Node</code> such as attributes, * childNodes, etc. * @since DOM Level 3 */ + @Override public Object getFeature(String feature, String version) { // we don't have any alternate node, either this node does the job // or we don't have anything that does return isSupported(feature, version) ? this : null; }
*** 1627,1636 **** --- 1704,1714 ---- * attributes, if it is an <code>Element</code>). * @return If the nodes, and possibly subtrees are equal, * <code>true</code> otherwise <code>false</code>. * @since DOM Level 3 */ + @Override public boolean isEqualNode(Node arg) { if (arg == this) { return true; } if (arg.getNodeType() != getNodeType()) {
*** 1703,1712 **** --- 1781,1791 ---- * * @param namespaceURI * @return th URI for the namespace * @since DOM Level 3 */ + @Override public String lookupNamespaceURI(String specifiedPrefix) { short type = this.getNodeType(); switch (type) { case Node.ELEMENT_NODE : {
*** 1795,1804 **** --- 1874,1884 ---- * @param namespaceURI The namespace URI to look for. * @return <code>true</code> if the specified <code>namespaceURI</code> * is the default namespace, <code>false</code> otherwise. * @since DOM Level 3 */ + @Override public boolean isDefaultNamespace(String namespaceURI){ /* // REVISIT: remove casts when DOM L3 becomes REC. short type = this.getNodeType(); switch (type) {
*** 1869,1878 **** --- 1949,1959 ---- * Look up the prefix associated to the given namespace URI, starting from this node. * * @param namespaceURI * @return the prefix for the namespace */ + @Override public String lookupPrefix(String namespaceURI){ // REVISIT: When Namespaces 1.1 comes out this may not be true // Prefix can't be bound to null namespace if (namespaceURI == null) {
*** 1930,1939 **** --- 2011,2021 ---- * @param other The node to test against. * @return Returns <code>true</code> if the nodes are the same, * <code>false</code> otherwise. * @since DOM Level 3 */ + @Override public boolean isSameNode(Node other) { // we do not use any wrapper so the answer is obvious return this == other; }
*** 1980,1989 **** --- 2062,2072 ---- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than * fit in a <code>DOMString</code> variable on the implementation * platform. * @since DOM Level 3 */ + @Override public void setTextContent(String textContent) throws DOMException { setNodeValue(textContent); } /**
*** 2029,2038 **** --- 2112,2122 ---- * DOMSTRING_SIZE_ERR: Raised when it would return more characters than * fit in a <code>DOMString</code> variable on the implementation * platform. * @since DOM Level 3 */ + @Override public String getTextContent() throws DOMException { return getNodeValue(); // overriden in some subclasses } /**
*** 2041,2050 **** --- 2125,2135 ---- * @param other The node to compare against this node. * @return Returns how the given node is positioned relatively to this * node. * @since DOM Level 3 */ + @Override public short compareDocumentPosition(Node other) throws DOMException { return 0; } /**
*** 2069,2086 **** --- 2154,2173 ---- * teleconference 30 May 2001).If the base HTML element is not yet * attached to a document, does the insert change the Document.baseURI? * Yes. (F2F 26 Sep 2001) * @since DOM Level 3 */ + @Override public String getBaseURI() { return null; } /** * DOM Level 3 * Renaming node */ + @Override public Node renameNode(Node n, String namespaceURI, String name) throws DOMException{ return n;
*** 2089,2106 **** --- 2176,2195 ---- /** * DOM Level 3 * Normalize document. */ + @Override public void normalizeDocument(){ } /** * The configuration used when <code>Document.normalizeDocument</code> is * invoked. * @since DOM Level 3 */ + @Override public DOMConfiguration getDomConfig(){ return null; }
*** 2108,2119 **** protected String fDocumentURI; /** * DOM Level 3 */ public void setDocumentURI(String documentURI){ - fDocumentURI= documentURI; } /** * DOM Level 3 --- 2197,2208 ---- protected String fDocumentURI; /** * DOM Level 3 */ + @Override public void setDocumentURI(String documentURI){ fDocumentURI= documentURI; } /** * DOM Level 3
*** 2121,2130 **** --- 2210,2220 ---- * <br>Beware that when the <code>Document</code> supports the feature * "HTML" , the href attribute of the HTML BASE element takes precedence * over this attribute. * @since DOM Level 3 */ + @Override public String getDocumentURI(){ return fDocumentURI; } /**DOM Level 3 feature: Document actualEncoding */
*** 2155,2164 **** --- 2245,2255 ---- } /** * DOM Level 3 */ + @Override public Text replaceWholeText(String content) throws DOMException{ /* if (needsSyncData()) {
*** 2208,2217 **** --- 2299,2309 ---- * DOM Level 3 * Returns all text of <code>Text</code> nodes logically-adjacent text * nodes to this node, concatenated in document order. * @since DOM Level 3 */ + @Override public String getWholeText(){ /* if (needsSyncData()) { synchronizeData();
*** 2233,2249 **** /** * DOM Level 3 * Returns whether this text node contains whitespace in element content, * often abusively called "ignorable whitespace". */ public boolean isElementContentWhitespace(){ return false; } - - - /** * NON-DOM: set the type of this attribute to be ID type. * * @param id */ --- 2325,2339 ---- /** * DOM Level 3 * Returns whether this text node contains whitespace in element content, * often abusively called "ignorable whitespace". */ + @Override public boolean isElementContentWhitespace(){ return false; } /** * NON-DOM: set the type of this attribute to be ID type. * * @param id */
*** 2252,2317 **** } /** * DOM Level 3: register the given attribute node as an ID attribute */ public void setIdAttribute(String name, boolean makeId) { //PENDING } /** * DOM Level 3: register the given attribute node as an ID attribute */ public void setIdAttributeNode(Attr at, boolean makeId) { //PENDING } /** * DOM Level 3: register the given attribute node as an ID attribute */ public void setIdAttributeNS(String namespaceURI, String localName, boolean makeId) { //PENDING } /** * Method getSchemaTypeInfo. * @return TypeInfo */ public TypeInfo getSchemaTypeInfo(){ return null; //PENDING } public boolean isId() { return false; //PENDING } private String xmlEncoding; public String getXmlEncoding( ) { return xmlEncoding; } public void setXmlEncoding( String xmlEncoding ) { this.xmlEncoding = xmlEncoding; } private boolean xmlStandalone; public boolean getXmlStandalone() { return xmlStandalone; } public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; } private String xmlVersion; public String getXmlVersion() { return xmlVersion; } public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; } - - } --- 2342,2415 ---- } /** * DOM Level 3: register the given attribute node as an ID attribute */ + @Override public void setIdAttribute(String name, boolean makeId) { //PENDING } /** * DOM Level 3: register the given attribute node as an ID attribute */ + @Override public void setIdAttributeNode(Attr at, boolean makeId) { //PENDING } /** * DOM Level 3: register the given attribute node as an ID attribute */ + @Override public void setIdAttributeNS(String namespaceURI, String localName, boolean makeId) { //PENDING } /** * Method getSchemaTypeInfo. * @return TypeInfo */ + @Override public TypeInfo getSchemaTypeInfo(){ return null; //PENDING } + @Override public boolean isId() { return false; //PENDING } private String xmlEncoding; + @Override public String getXmlEncoding( ) { return xmlEncoding; } public void setXmlEncoding( String xmlEncoding ) { this.xmlEncoding = xmlEncoding; } private boolean xmlStandalone; + @Override public boolean getXmlStandalone() { return xmlStandalone; } + @Override public void setXmlStandalone(boolean xmlStandalone) throws DOMException { this.xmlStandalone = xmlStandalone; } private String xmlVersion; + @Override public String getXmlVersion() { return xmlVersion; } + @Override public void setXmlVersion(String xmlVersion) throws DOMException { this.xmlVersion = xmlVersion; } }