|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Node
A Node. XML node types should be contained as a subset of the available node types. Currently, only XML ELEMENT and CHARDATA nodes are supported. One additional (non-XML) type is available: BINARY.
| Field Summary | |
|---|---|
static byte |
BINARY
Node type binary data. |
static byte |
CHARDATA
Node type character data. |
static byte |
ELEMENT
Node type element. |
| Method Summary | |
|---|---|
boolean |
contentEquals(Node n)
Returns true if and only if the specified node has the same
type, value, and attributes as this node, and their children recursively
satisfy the same predicate. |
boolean |
equals(Object o)
Returns true if and only if the specified object is also a
Node, they have the same type, their node values are equal,
their attributes are equals as a set, and their children are recursively
equal according to this definition. |
String |
getAttribute(String attrName)
Returns the attribute with the given name. |
String[] |
getAttributeNames()
Returns the names of this Node's attributes. |
List<Attribute> |
getAttributes()
Returns the attributes of this Node. |
byte[] |
getBytes()
Returns the value of this node as bytes. |
List<? extends Node> |
getChildren()
Returns the children of this Node. |
String |
getNodeValue()
Returns the value of this Node. |
byte |
getType()
Returns the node type of this Node. |
int |
hashCode()
Recursively computes a hash code based on the node type, node value, attributes, and children. |
boolean |
isMutable()
Returns true if this Node is mutable,
false otherwise. |
| Field Detail |
|---|
static final byte ELEMENT
Node has a value, attributes, and
children.
static final byte CHARDATA
Node only has a value.
static final byte BINARY
Node only has a value.
| Method Detail |
|---|
boolean isMutable()
true if this Node is mutable,
false otherwise.
true if mutable, false if immutable.byte getType()
Node.
String getNodeValue()
Node. When the node represents
a character data node, the returned value will be the character data.
When the node represents an element node, the returned value will
by the tag name of the element. When the node represents binary data,
the returned value will be a base64 encoding of the data.
byte[] getBytes()
BINARY nodes. For CHARDATA and
ELEMENT nodes the returned bytes will be
getNodeValue() encoded as bytes using the default
character encoding.
List<Attribute> getAttributes()
Node. In case
the node represents character data, the empty list is returned.
Node.String getAttribute(String attrName)
String[] getAttributeNames()
Node's attributes.
If the node represents character data the returned array is empty.
List<? extends Node> getChildren()
Node.
If the node represents character data the empty list is returned.
Node.boolean equals(Object o)
true if and only if the specified object is also a
Node, they have the same type, their node values are equal,
their attributes are equals as a set, and their children are recursively
equal according to this definition.
equals in class Objectboolean contentEquals(Node n)
true if and only if the specified node has the same
type, value, and attributes as this node, and their children recursively
satisfy the same predicate.
int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||