dtmnodeproxy.java

来自「JAVA 所有包」· Java 代码 · 共 2,314 行 · 第 1/5 页

JAVA
2,314
字号
               || isNamespaceURIWildCard               || (namespaceURI != null && namespaceURI.equals(nsURI)))        {               listVector.add(tempNode);         }       }      if(tempNode.hasChildNodes())      {        NodeList nl = tempNode.getChildNodes();                         for(int i = 0; i < nl.getLength(); i++)        {          traverseChildren(listVector, nl.item(i), namespaceURI, localname,                           isNamespaceURIWildCard, isLocalNameWildCard);        }      }    }  }  /**   *   * @param elementId   *   *   * @see org.w3c.dom.Document as of DOM Level 2   */  public final Element getElementById(String elementId)  {       return (Element) dtm.getNode(dtm.getElementById(elementId));  }  /**   *   * @param offset   *   *    *   * @throws DOMException   * @see org.w3c.dom.Text   */  public final Text splitText(int offset) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   *    *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final String getData() throws DOMException  {    return dtm.getNodeValue(node);  }  /**   *   * @param data   *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final void setData(String data) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   *    * @see org.w3c.dom.CharacterData   */  public final int getLength()  {    // %OPT% This should do something smarter?    return dtm.getNodeValue(node).length();  }  /**   *   * @param offset   * @param count   *   *    *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final String substringData(int offset, int count) throws DOMException  {    return getData().substring(offset,offset+count);  }  /**   *   * @param arg   *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final void appendData(String arg) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param offset   * @param arg   *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final void insertData(int offset, String arg) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param offset   * @param count   *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final void deleteData(int offset, int count) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param offset   * @param count   * @param arg   *   * @throws DOMException   * @see org.w3c.dom.CharacterData   */  public final void replaceData(int offset, int count, String arg)    throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   *    * @see org.w3c.dom.Element   */  public final String getTagName()  {    return dtm.getNodeName(node);  }  /**   *   * @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);  }  /**   *   * @param name   *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final void removeAttribute(String name) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param name   *   *    * @see org.w3c.dom.Element   */  public final Attr getAttributeNode(String name)  {    DTMNamedNodeMap  map = new DTMNamedNodeMap(dtm, node);    return (Attr)map.getNamedItem(name);  }  /**   *   * @param newAttr   *   *    *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final Attr setAttributeNode(Attr newAttr) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param oldAttr   *   *    *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final Attr removeAttributeNode(Attr oldAttr) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   * Introduced in DOM Level 2.   *   *    */  public boolean hasAttributes()  {    return DTM.NULL != dtm.getFirstAttribute(node);  }  /** @see org.w3c.dom.Element */  public final void normalize()  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param namespaceURI   * @param localName   *   *    * @see org.w3c.dom.Element   */  public final String getAttributeNS(String namespaceURI, String localName)  {    Node retNode = null;    int n = dtm.getAttributeNode(node,namespaceURI,localName);    if(n != DTM.NULL)            retNode = dtm.getNode(n);    return (null == retNode) ? EMPTYSTRING : retNode.getNodeValue();  }  /**   *   * @param namespaceURI   * @param qualifiedName   * @param value   *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final void setAttributeNS(                                   String namespaceURI, String qualifiedName, String value)    throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param namespaceURI   * @param localName   *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final void removeAttributeNS(String namespaceURI, String localName)    throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   * @param namespaceURI   * @param localName   *   *    * @see org.w3c.dom.Element   */  public final Attr getAttributeNodeNS(String namespaceURI, String localName)  {       Attr retAttr = null;       int n = dtm.getAttributeNode(node,namespaceURI,localName);       if(n != DTM.NULL)               retAttr = (Attr) dtm.getNode(n);       return retAttr;  }  /**   *   * @param newAttr   *   *    *   * @throws DOMException   * @see org.w3c.dom.Element   */  public final Attr setAttributeNodeNS(Attr newAttr) throws DOMException  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   *   *    * @see org.w3c.dom.Attr   */  public final String getName()  {    return dtm.getNodeName(node);  }  /**   *   *    * @see org.w3c.dom.Attr   */  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.    // %REVIEW% if/when we become aware of DTDs/schemae.    return true;  }  /**   *   *    * @see org.w3c.dom.Attr   */  public final String getValue()  {    return dtm.getNodeValue(node);  }  /**   *   * @param value   * @see org.w3c.dom.Attr   */  public final void setValue(String value)  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   * Get the owner element of an attribute.   *   *    * @see org.w3c.dom.Attr as of DOM Level 2   */  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    // owner element.    int newnode = dtm.getParent(node);    return (newnode == DTM.NULL) ? null : (Element)(dtm.getNode(newnode));  }  /**   * NEEDSDOC Method adoptNode    *   *   * NEEDSDOC @param source   *   * 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   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.   * <p>   * An attribute specifying, as part of the XML declaration, the encoding   * 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   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.   * <p>   * An attribute specifying, as part of the XML declaration, the encoding   * of this document. This is <code>null</code> when unspecified.   * @since DOM Level 3   *   * NEEDSDOC @param encoding   */  public void setEncoding(String encoding)  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   * <p>EXPERIMENTAL! Based on the <a   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.   * <p>   * An attribute specifying, as part of the XML declaration, whether this   * document is standalone.   * @since DOM Level 3   *   * NEEDSDOC ($objectName$) @return   */  public boolean getStandalone()  {    throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR);  }  /**   * <p>EXPERIMENTAL! Based on the <a   * href='http://www.w3.org/TR/2001/WD-DOM-Level-3-Core-20010605'>Document   * Object Model (DOM) Level 3 Core Working Draft of 5 June 2001.</a>.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?