public abstract class Node extends Object
Copyright (C) 2002 Hewlett-Packard Company. This file is part of Sparta, an XML Parser, DOM, and XPath library. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
| 构造器和说明 |
|---|
Node() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract Object |
clone() |
protected abstract int |
computeHashCode()
Called whenever cached version of hashCode needs to be regenerated.
|
Object |
getAnnotation() |
Node |
getNextSibling()
Return the next node in the parent's list of children, or null if no such node.
|
Document |
getOwnerDocument()
The document that contains this node.
|
Element |
getParentNode()
The element that contains this node or null if this is a Document
or the root element of a document.
|
Node |
getPreviousSibling()
Return the previous node in the parent's list of children, or null if no such node.
|
int |
hashCode() |
protected static void |
htmlEncode(Writer writer,
String string)
Quote special XML characters '<', '>', '&', '"' if necessary,
and write to character stream.
|
void |
setAnnotation(Object annotation)
Use by client to attach arbitrary data to DOM document.
|
String |
toString()
Hierarchically concatenated text nodes.
|
String |
toXml()
XML representation of this node.
|
abstract Element |
xpathSelectElement(String xpath)
Select the first element that matches the relative XPath
expression with respect to this node, or null if
there is no match.
|
abstract Enumeration |
xpathSelectElements(String xpath)
Select all the elements that match the relative XPath
expression with respect to this node.
|
abstract String |
xpathSelectString(String xpath)
Select the first element that matches the relative XPath
expression with respect to this node, or null if
there is no match.
|
abstract Enumeration |
xpathSelectStrings(String xpath)
Select all the strings that match the relative XPath
expression with respect to this node.
|
boolean |
xpathSetStrings(String xpath,
String value)
For an xpath expression of the form "xpathPrefix/@attrName" set the
attribute "attrName" to attrValue on all elements that match
"XpathPrefix" which is an arbitrary xpath expression matching elements,
or for an xpath expression of the form "xpathPrefixe/text()" set the
text of all matching text nodes.
|
public Document getOwnerDocument()
public Element getParentNode()
public Node getPreviousSibling()
public Node getNextSibling()
public Object getAnnotation()
public void setAnnotation(Object annotation)
public String toXml() throws IOException
IOExceptionpublic boolean xpathSetStrings(String xpath, String value) throws ParseException
foreach element in node.xpathSelectElement(xpathPrefix): element.setAttribute( "attrName", value );
(Every matching child gets its attribute set.)
TTT TTT TTT
TTT
ParseExceptionpublic abstract Enumeration xpathSelectElements(String xpath) throws ParseException
ParseExceptionpublic abstract Enumeration xpathSelectStrings(String xpath) throws ParseException
ParseExceptionpublic abstract Element xpathSelectElement(String xpath) throws ParseException
ParseExceptionpublic abstract String xpathSelectString(String xpath) throws ParseException
ParseExceptionprotected static void htmlEncode(Writer writer, String string) throws IOException
IOExceptionprotected abstract int computeHashCode()
Copyright © 2013. All Rights Reserved.