dtmnodeproxy.java
来自「JAVA的一些源码 JAVA2 STANDARD EDITION DEVELO」· Java 代码 · 共 2,167 行 · 第 1/4 页
JAVA
2,167 行
/** * * @param deep * * @return * @see org.w3c.dom.Node -- DTMNodeProxy is read-only */ public final Node cloneNode(boolean deep) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @return * @see org.w3c.dom.Document */ public final DocumentType getDoctype() { return null; } /** * * @return * @see org.w3c.dom.Document */ public final DOMImplementation getImplementation() { return implementation; } /** This is a bit of a problem in DTM, since a DTM may be a Document * Fragment and hence not have a clear-cut Document Element. We can * make it work in the well-formed cases but would that be confusing for others? * * @return * @see org.w3c.dom.Document */ public final Element getDocumentElement() { int dochandle=dtm.getDocument(); int elementhandle=DTM.NULL; for(int kidhandle=dtm.getFirstChild(dochandle); kidhandle!=DTM.NULL; kidhandle=dtm.getNextSibling(kidhandle)) { switch(dtm.getNodeType(kidhandle)) { case Node.ELEMENT_NODE: if(elementhandle!=DTM.NULL) { elementhandle=DTM.NULL; // More than one; ill-formed. kidhandle=dtm.getLastChild(dochandle); // End loop } else elementhandle=kidhandle; break; // These are harmless; document is still wellformed case Node.COMMENT_NODE: case Node.PROCESSING_INSTRUCTION_NODE: case Node.DOCUMENT_TYPE_NODE: break; default: elementhandle=DTM.NULL; // ill-formed kidhandle=dtm.getLastChild(dochandle); // End loop break; } } if(elementhandle==DTM.NULL) throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); else return (Element)(dtm.getNode(elementhandle)); } /** * * @param tagName * * @return * * @throws DOMException * @see org.w3c.dom.Document */ public final Element createElement(String tagName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @return * @see org.w3c.dom.Document */ public final DocumentFragment createDocumentFragment() { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param data * * @return * @see org.w3c.dom.Document */ public final Text createTextNode(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param data * * @return * @see org.w3c.dom.Document */ public final Comment createComment(String data) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param data * * @return * * @throws DOMException * @see org.w3c.dom.Document */ public final CDATASection createCDATASection(String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param target * @param data * * @return * * @throws DOMException * @see org.w3c.dom.Document */ public final ProcessingInstruction createProcessingInstruction( String target, String data) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param name * * @return * * @throws DOMException * @see org.w3c.dom.Document */ public final Attr createAttribute(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param name * * @return * * @throws DOMException * @see org.w3c.dom.Document */ public final EntityReference createEntityReference(String name) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param tagname * * @return * @see org.w3c.dom.Document */ public final NodeList getElementsByTagName(String tagname) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param importedNode * @param deep * * @return * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 -- DTMNodeProxy is read-only */ public final Node importNode(Node importedNode, boolean deep) throws DOMException { throw new DTMDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR); } /** * * @param namespaceURI * @param qualifiedName * * @return * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 */ public final Element createElementNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param namespaceURI * @param qualifiedName * * @return * * @throws DOMException * @see org.w3c.dom.Document as of DOM Level 2 */ public final Attr createAttributeNS( String namespaceURI, String qualifiedName) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param namespaceURI * @param localName * * @return * @see org.w3c.dom.Document as of DOM Level 2 */ public final NodeList getElementsByTagNameNS(String namespaceURI, String localName) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param elementId * * @return * @see org.w3c.dom.Document as of DOM Level 2 */ public final Element getElementById(String elementId) { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param offset * * @return * * @throws DOMException * @see org.w3c.dom.Text */ public final Text splitText(int offset) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @return * * @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); } /** * * @return * @see org.w3c.dom.CharacterData */ public final int getLength() { // %OPT% This should do something smarter? return dtm.getNodeValue(node).length(); } /** * * @param offset * @param count * * @return * * @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); } /** * * @return * @see org.w3c.dom.Element */ public final String getTagName() { return dtm.getNodeName(node); } /** * * @param name * * @return * @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) ? null : 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 * * @return * @see org.w3c.dom.Element */ public final Attr getAttributeNode(String name) { DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); return (Attr)map.getNamedItem(name); } /** * * @param newAttr * * @return * * @throws DOMException * @see org.w3c.dom.Element */ public final Attr setAttributeNode(Attr newAttr) throws DOMException { throw new DTMDOMException(DOMException.NOT_SUPPORTED_ERR); } /** * * @param oldAttr * * @return * * @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. * * @return */ 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 * * @return * @see org.w3c.dom.Element */ public final String getAttributeNS(String namespaceURI, String localName) { DTMNamedNodeMap map = new DTMNamedNodeMap(dtm, node); Node node = map.getNamedItemNS(namespaceURI,localName); return (null == node) ? null : node.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); }
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?