jaxp/src/org/w3c/dom/Node.java
changeset 25262 1fe892ba017a
parent 12457 c348e06f0e82
equal deleted inserted replaced
24908:2dcf544eb7ed 25262:1fe892ba017a
   297      * also the <code>Document</code> object used to create new nodes. When
   297      * also the <code>Document</code> object used to create new nodes. When
   298      * this node is a <code>Document</code> or a <code>DocumentType</code>
   298      * this node is a <code>Document</code> or a <code>DocumentType</code>
   299      * which is not used with any <code>Document</code> yet, this is
   299      * which is not used with any <code>Document</code> yet, this is
   300      * <code>null</code>.
   300      * <code>null</code>.
   301      *
   301      *
   302      * @since DOM Level 2
   302      * @since 1.4, DOM Level 2
   303      */
   303      */
   304     public Document getOwnerDocument();
   304     public Document getOwnerDocument();
   305 
   305 
   306     /**
   306     /**
   307      * Inserts the node <code>newChild</code> before the existing child node
   307      * Inserts the node <code>newChild</code> before the existing child node
   333      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   333      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   334      *   this exception might be raised if the DOM implementation doesn't
   334      *   this exception might be raised if the DOM implementation doesn't
   335      *   support the insertion of a <code>DocumentType</code> or
   335      *   support the insertion of a <code>DocumentType</code> or
   336      *   <code>Element</code> node.
   336      *   <code>Element</code> node.
   337      *
   337      *
   338      * @since DOM Level 3
   338      * @since 1.4, DOM Level 3
   339      */
   339      */
   340     public Node insertBefore(Node newChild,
   340     public Node insertBefore(Node newChild,
   341                              Node refChild)
   341                              Node refChild)
   342                              throws DOMException;
   342                              throws DOMException;
   343 
   343 
   371      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   371      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   372      *   this exception might be raised if the DOM implementation doesn't
   372      *   this exception might be raised if the DOM implementation doesn't
   373      *   support the replacement of the <code>DocumentType</code> child or
   373      *   support the replacement of the <code>DocumentType</code> child or
   374      *   <code>Element</code> child.
   374      *   <code>Element</code> child.
   375      *
   375      *
   376      * @since DOM Level 3
   376      * @since 1.4, DOM Level 3
   377      */
   377      */
   378     public Node replaceChild(Node newChild,
   378     public Node replaceChild(Node newChild,
   379                              Node oldChild)
   379                              Node oldChild)
   380                              throws DOMException;
   380                              throws DOMException;
   381 
   381 
   391      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   391      *   <br>NOT_SUPPORTED_ERR: if this node is of type <code>Document</code>,
   392      *   this exception might be raised if the DOM implementation doesn't
   392      *   this exception might be raised if the DOM implementation doesn't
   393      *   support the removal of the <code>DocumentType</code> child or the
   393      *   support the removal of the <code>DocumentType</code> child or the
   394      *   <code>Element</code> child.
   394      *   <code>Element</code> child.
   395      *
   395      *
   396      * @since DOM Level 3
   396      * @since 1.4, DOM Level 3
   397      */
   397      */
   398     public Node removeChild(Node oldChild)
   398     public Node removeChild(Node oldChild)
   399                             throws DOMException;
   399                             throws DOMException;
   400 
   400 
   401     /**
   401     /**
   420      *   <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
   420      *   <br>NOT_SUPPORTED_ERR: if the <code>newChild</code> node is a child
   421      *   of the <code>Document</code> node, this exception might be raised
   421      *   of the <code>Document</code> node, this exception might be raised
   422      *   if the DOM implementation doesn't support the removal of the
   422      *   if the DOM implementation doesn't support the removal of the
   423      *   <code>DocumentType</code> child or <code>Element</code> child.
   423      *   <code>DocumentType</code> child or <code>Element</code> child.
   424      *
   424      *
   425      * @since DOM Level 3
   425      * @since 1.4, DOM Level 3
   426      */
   426      */
   427     public Node appendChild(Node newChild)
   427     public Node appendChild(Node newChild)
   428                             throws DOMException;
   428                             throws DOMException;
   429 
   429 
   430     /**
   430     /**
   489      * <p ><b>Note:</b> In cases where the document contains
   489      * <p ><b>Note:</b> In cases where the document contains
   490      * <code>CDATASections</code>, the normalize operation alone may not be
   490      * <code>CDATASections</code>, the normalize operation alone may not be
   491      * sufficient, since XPointers do not differentiate between
   491      * sufficient, since XPointers do not differentiate between
   492      * <code>Text</code> nodes and <code>CDATASection</code> nodes.
   492      * <code>Text</code> nodes and <code>CDATASection</code> nodes.
   493      *
   493      *
   494      * @since DOM Level 3
   494      * @since 1.4, DOM Level 3
   495      */
   495      */
   496     public void normalize();
   496     public void normalize();
   497 
   497 
   498     /**
   498     /**
   499      *  Tests whether the DOM implementation implements a specific feature and
   499      *  Tests whether the DOM implementation implements a specific feature and
   501      * @param feature  The name of the feature to test.
   501      * @param feature  The name of the feature to test.
   502      * @param version  This is the version number of the feature to test.
   502      * @param version  This is the version number of the feature to test.
   503      * @return Returns <code>true</code> if the specified feature is
   503      * @return Returns <code>true</code> if the specified feature is
   504      *   supported on this node, <code>false</code> otherwise.
   504      *   supported on this node, <code>false</code> otherwise.
   505      *
   505      *
   506      * @since DOM Level 2
   506      * @since 1.4, DOM Level 2
   507      */
   507      */
   508     public boolean isSupported(String feature,
   508     public boolean isSupported(String feature,
   509                                String version);
   509                                String version);
   510 
   510 
   511     /**
   511     /**
   521      * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
   521      * <p ><b>Note:</b> Per the <em>Namespaces in XML</em> Specification [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
   522      *  an attribute does not inherit its namespace from the element it is
   522      *  an attribute does not inherit its namespace from the element it is
   523      * attached to. If an attribute is not explicitly given a namespace, it
   523      * attached to. If an attribute is not explicitly given a namespace, it
   524      * simply has no namespace.
   524      * simply has no namespace.
   525      *
   525      *
   526      * @since DOM Level 2
   526      * @since 1.4, DOM Level 2
   527      */
   527      */
   528     public String getNamespaceURI();
   528     public String getNamespaceURI();
   529 
   529 
   530     /**
   530     /**
   531      * The namespace prefix of this node, or <code>null</code> if it is
   531      * The namespace prefix of this node, or <code>null</code> if it is
   545      * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
   545      * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
   546      * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
   546      * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
   547      * method, such as <code>createElement</code> from the
   547      * method, such as <code>createElement</code> from the
   548      * <code>Document</code> interface, this is always <code>null</code>.
   548      * <code>Document</code> interface, this is always <code>null</code>.
   549      *
   549      *
   550      * @since DOM Level 2
   550      * @since 1.4, DOM Level 2
   551      */
   551      */
   552     public String getPrefix();
   552     public String getPrefix();
   553     /**
   553     /**
   554      * The namespace prefix of this node, or <code>null</code> if it is
   554      * The namespace prefix of this node, or <code>null</code> if it is
   555      * unspecified. When it is defined to be <code>null</code>, setting it
   555      * unspecified. When it is defined to be <code>null</code>, setting it
   582      *   http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
   582      *   http://www.w3.org/XML/1998/namespace</a>", if this node is an attribute and the specified prefix is "xmlns" and
   583      *   the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
   583      *   the <code>namespaceURI</code> of this node is different from "<a href='http://www.w3.org/2000/xmlns/'>http://www.w3.org/2000/xmlns/</a>", or if this node is an attribute and the <code>qualifiedName</code> of
   584      *   this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
   584      *   this node is "xmlns" [<a href='http://www.w3.org/TR/1999/REC-xml-names-19990114/'>XML Namespaces</a>]
   585      *   .
   585      *   .
   586      *
   586      *
   587      * @since DOM Level 2
   587      * @since 1.4, DOM Level 2
   588      */
   588      */
   589     public void setPrefix(String prefix)
   589     public void setPrefix(String prefix)
   590                                throws DOMException;
   590                                throws DOMException;
   591 
   591 
   592     /**
   592     /**
   594      * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
   594      * <br>For nodes of any type other than <code>ELEMENT_NODE</code> and
   595      * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
   595      * <code>ATTRIBUTE_NODE</code> and nodes created with a DOM Level 1
   596      * method, such as <code>Document.createElement()</code>, this is always
   596      * method, such as <code>Document.createElement()</code>, this is always
   597      * <code>null</code>.
   597      * <code>null</code>.
   598      *
   598      *
   599      * @since DOM Level 2
   599      * @since 1.4, DOM Level 2
   600      */
   600      */
   601     public String getLocalName();
   601     public String getLocalName();
   602 
   602 
   603     /**
   603     /**
   604      * Returns whether this node (if it is an element) has any attributes.
   604      * Returns whether this node (if it is an element) has any attributes.
   605      * @return Returns <code>true</code> if this node has any attributes,
   605      * @return Returns <code>true</code> if this node has any attributes,
   606      *   <code>false</code> otherwise.
   606      *   <code>false</code> otherwise.
   607      *
   607      *
   608      * @since DOM Level 2
   608      * @since 1.4, DOM Level 2
   609      */
   609      */
   610     public boolean hasAttributes();
   610     public boolean hasAttributes();
   611 
   611 
   612     /**
   612     /**
   613      * The absolute base URI of this node or <code>null</code> if the
   613      * The absolute base URI of this node or <code>null</code> if the
   617      * , the base URI is computed using first the value of the href
   617      * , the base URI is computed using first the value of the href
   618      * attribute of the HTML BASE element if any, and the value of the
   618      * attribute of the HTML BASE element if any, and the value of the
   619      * <code>documentURI</code> attribute from the <code>Document</code>
   619      * <code>documentURI</code> attribute from the <code>Document</code>
   620      * interface otherwise.
   620      * interface otherwise.
   621      *
   621      *
   622      * @since DOM Level 3
   622      * @since 1.5, DOM Level 3
   623      */
   623      */
   624     public String getBaseURI();
   624     public String getBaseURI();
   625 
   625 
   626     // DocumentPosition
   626     // DocumentPosition
   627     /**
   627     /**
   664      * @exception DOMException
   664      * @exception DOMException
   665      *   NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
   665      *   NOT_SUPPORTED_ERR: when the compared nodes are from different DOM
   666      *   implementations that do not coordinate to return consistent
   666      *   implementations that do not coordinate to return consistent
   667      *   implementation-specific results.
   667      *   implementation-specific results.
   668      *
   668      *
   669      * @since DOM Level 3
   669      * @since 1.5, DOM Level 3
   670      */
   670      */
   671     public short compareDocumentPosition(Node other)
   671     public short compareDocumentPosition(Node other)
   672                                          throws DOMException;
   672                                          throws DOMException;
   673 
   673 
   674     /**
   674     /**
   715      * @exception DOMException
   715      * @exception DOMException
   716      *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
   716      *   DOMSTRING_SIZE_ERR: Raised when it would return more characters than
   717      *   fit in a <code>DOMString</code> variable on the implementation
   717      *   fit in a <code>DOMString</code> variable on the implementation
   718      *   platform.
   718      *   platform.
   719      *
   719      *
   720      * @since DOM Level 3
   720      * @since 1.5, DOM Level 3
   721      */
   721      */
   722     public String getTextContent()
   722     public String getTextContent()
   723                                          throws DOMException;
   723                                          throws DOMException;
   724     /**
   724     /**
   725      * This attribute returns the text content of this node and its
   725      * This attribute returns the text content of this node and its
   763      * </tr>
   763      * </tr>
   764      * </table>
   764      * </table>
   765      * @exception DOMException
   765      * @exception DOMException
   766      *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
   766      *   NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
   767      *
   767      *
   768      * @since DOM Level 3
   768      * @since 1.5, DOM Level 3
   769      */
   769      */
   770     public void setTextContent(String textContent)
   770     public void setTextContent(String textContent)
   771                                          throws DOMException;
   771                                          throws DOMException;
   772 
   772 
   773     /**
   773     /**
   781      * always has exactly the same effect.
   781      * always has exactly the same effect.
   782      * @param other The node to test against.
   782      * @param other The node to test against.
   783      * @return Returns <code>true</code> if the nodes are the same,
   783      * @return Returns <code>true</code> if the nodes are the same,
   784      *   <code>false</code> otherwise.
   784      *   <code>false</code> otherwise.
   785      *
   785      *
   786      * @since DOM Level 3
   786      * @since 1.5, DOM Level 3
   787      */
   787      */
   788     public boolean isSameNode(Node other);
   788     public boolean isSameNode(Node other);
   789 
   789 
   790     /**
   790     /**
   791      * Look up the prefix associated to the given namespace URI, starting from
   791      * Look up the prefix associated to the given namespace URI, starting from
   796      * @return Returns an associated namespace prefix if found or
   796      * @return Returns an associated namespace prefix if found or
   797      *   <code>null</code> if none is found. If more than one prefix are
   797      *   <code>null</code> if none is found. If more than one prefix are
   798      *   associated to the namespace prefix, the returned namespace prefix
   798      *   associated to the namespace prefix, the returned namespace prefix
   799      *   is implementation dependent.
   799      *   is implementation dependent.
   800      *
   800      *
   801      * @since DOM Level 3
   801      * @since 1.5, DOM Level 3
   802      */
   802      */
   803     public String lookupPrefix(String namespaceURI);
   803     public String lookupPrefix(String namespaceURI);
   804 
   804 
   805     /**
   805     /**
   806      *  This method checks if the specified <code>namespaceURI</code> is the
   806      *  This method checks if the specified <code>namespaceURI</code> is the
   808      * @param namespaceURI The namespace URI to look for.
   808      * @param namespaceURI The namespace URI to look for.
   809      * @return Returns <code>true</code> if the specified
   809      * @return Returns <code>true</code> if the specified
   810      *   <code>namespaceURI</code> is the default namespace,
   810      *   <code>namespaceURI</code> is the default namespace,
   811      *   <code>false</code> otherwise.
   811      *   <code>false</code> otherwise.
   812      *
   812      *
   813      * @since DOM Level 3
   813      * @since 1.5, DOM Level 3
   814      */
   814      */
   815     public boolean isDefaultNamespace(String namespaceURI);
   815     public boolean isDefaultNamespace(String namespaceURI);
   816 
   816 
   817     /**
   817     /**
   818      * Look up the namespace URI associated to the given prefix, starting from
   818      * Look up the namespace URI associated to the given prefix, starting from
   822      *   <code>null</code>, the method will return the default namespace URI
   822      *   <code>null</code>, the method will return the default namespace URI
   823      *   if any.
   823      *   if any.
   824      * @return Returns the associated namespace URI or <code>null</code> if
   824      * @return Returns the associated namespace URI or <code>null</code> if
   825      *   none is found.
   825      *   none is found.
   826      *
   826      *
   827      * @since DOM Level 3
   827      * @since 1.5, DOM Level 3
   828      */
   828      */
   829     public String lookupNamespaceURI(String prefix);
   829     public String lookupNamespaceURI(String prefix);
   830 
   830 
   831     /**
   831     /**
   832      * Tests whether two nodes are equal.
   832      * Tests whether two nodes are equal.
   888      * specification are expected to be updated accordingly.
   888      * specification are expected to be updated accordingly.
   889      * @param arg The node to compare equality with.
   889      * @param arg The node to compare equality with.
   890      * @return Returns <code>true</code> if the nodes are equal,
   890      * @return Returns <code>true</code> if the nodes are equal,
   891      *   <code>false</code> otherwise.
   891      *   <code>false</code> otherwise.
   892      *
   892      *
   893      * @since DOM Level 3
   893      * @since 1.5, DOM Level 3
   894      */
   894      */
   895     public boolean isEqualNode(Node arg);
   895     public boolean isEqualNode(Node arg);
   896 
   896 
   897     /**
   897     /**
   898      *  This method returns a specialized object which implements the
   898      *  This method returns a specialized object which implements the
   913      *   implements the <code>Node</code> interface, it must delegate to the
   913      *   implements the <code>Node</code> interface, it must delegate to the
   914      *   primary core <code>Node</code> and not return results inconsistent
   914      *   primary core <code>Node</code> and not return results inconsistent
   915      *   with the primary core <code>Node</code> such as attributes,
   915      *   with the primary core <code>Node</code> such as attributes,
   916      *   childNodes, etc.
   916      *   childNodes, etc.
   917      *
   917      *
   918      * @since DOM Level 3
   918      * @since 1.5, DOM Level 3
   919      */
   919      */
   920     public Object getFeature(String feature,
   920     public Object getFeature(String feature,
   921                              String version);
   921                              String version);
   922 
   922 
   923     /**
   923     /**
   930      * @param handler The handler to associate to that key, or
   930      * @param handler The handler to associate to that key, or
   931      *   <code>null</code>.
   931      *   <code>null</code>.
   932      * @return Returns the <code>DOMUserData</code> previously associated to
   932      * @return Returns the <code>DOMUserData</code> previously associated to
   933      *   the given key on this node, or <code>null</code> if there was none.
   933      *   the given key on this node, or <code>null</code> if there was none.
   934      *
   934      *
   935      * @since DOM Level 3
   935      * @since 1.5, DOM Level 3
   936      */
   936      */
   937     public Object setUserData(String key,
   937     public Object setUserData(String key,
   938                               Object data,
   938                               Object data,
   939                               UserDataHandler handler);
   939                               UserDataHandler handler);
   940 
   940 
   944      * <code>setUserData</code> with the same key.
   944      * <code>setUserData</code> with the same key.
   945      * @param key The key the object is associated to.
   945      * @param key The key the object is associated to.
   946      * @return Returns the <code>DOMUserData</code> associated to the given
   946      * @return Returns the <code>DOMUserData</code> associated to the given
   947      *   key on this node, or <code>null</code> if there was none.
   947      *   key on this node, or <code>null</code> if there was none.
   948      *
   948      *
   949      * @since DOM Level 3
   949      * @since 1.5, DOM Level 3
   950      */
   950      */
   951     public Object getUserData(String key);
   951     public Object getUserData(String key);
   952 
   952 
   953 }
   953 }