java.io.Serializable
public final class AnyNode
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field | Description |
---|---|---|
static short |
ATTRIBUTE |
Representation for an attribute node.
|
static short |
COMMENT |
Representation for a comment node.
|
static short |
ELEMENT |
Representation for an element node.
|
static short |
NAMESPACE |
Representation for a Namespace node.
|
static short |
PI |
Representation for a processing instruction node.
|
static short |
TEXT |
Representation for a text node.
|
Constructor | Description |
---|---|
AnyNode() |
Default constructor: creates an empty element node
|
AnyNode(short type,
java.lang.String localName,
java.lang.String prefix,
java.lang.String uri,
java.lang.String value) |
Creates a node given all the necessary information:
type, localName, prefix, uri and value.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addAnyNode(AnyNode node) |
Adds an AnyNode to the current node
|
void |
addAttribute(AnyNode node) |
Adds an attribute to the current node.
|
void |
addChild(AnyNode node) |
Adds a child AnyNode to this node.
|
void |
addNamespace(AnyNode node) |
Appends an namespace to the current node.
|
protected void |
appendSibling(AnyNode node) |
Appends a sibling AnyNode to the current node.
|
AnyNode |
getFirstAttribute() |
Returns the first attribute of the current ELEMENT node
or null.
|
AnyNode |
getFirstChild() |
Returns the first Child node of this node.
|
protected AnyNode |
getFirstChildNode() |
Returns the first child node in the tree.
|
AnyNode |
getFirstNamespace() |
Returns the first namespace of the current ELEMENT node or null.
|
java.lang.String |
getLocalName() |
Returns the local name of the node.
|
java.lang.String |
getNamespacePrefix() |
Returns the namespace prefix associated with the namespace URI of this
node.
|
java.lang.String |
getNamespaceURI() |
Returns the namespace URI of the node.
|
AnyNode |
getNextSibling() |
Returns the next sibling of the current node.
|
short |
getNodeType() |
Returns the type of this node.
|
java.lang.String |
getStringValue() |
Returns the string value of the node.
|
java.lang.String |
toString() |
Returns the String representation of this AnyNode.
|
public static final short ELEMENT
public static final short ATTRIBUTE
public static final short NAMESPACE
public static final short PI
public static final short COMMENT
public static final short TEXT
public AnyNode()
public AnyNode(short type, java.lang.String localName, java.lang.String prefix, java.lang.String uri, java.lang.String value)
type
- the node type.localName
- the name of the node.prefix
- the prefix if any of the namespace.uri
- the namespace uri of this node.value
- the value of this node.public void addAnyNode(AnyNode node)
node
- the node to appendpublic void addChild(AnyNode node)
Adds a child AnyNode to this node. A 'child' can be either an ELEMENT node, a COMMENT node, a TEXT node or a PROCESSING INSTRUCTION. If the current node already has a child then the node to add will be append as a sibling.
Note: you cannot add a child to a TEXT node.
node
- the node to add.public void addAttribute(AnyNode node)
node
- the attribute to add.public void addNamespace(AnyNode node)
node
- the attribute to add.public AnyNode getFirstAttribute()
public AnyNode getFirstNamespace()
public AnyNode getFirstChild()
public AnyNode getNextSibling()
public short getNodeType()
public java.lang.String getLocalName()
public java.lang.String getNamespaceURI()
public java.lang.String getStringValue()
public java.lang.String getNamespacePrefix()
public java.lang.String toString()
toString
in class java.lang.Object
protected void appendSibling(AnyNode node)
node
- the node to addprotected AnyNode getFirstChildNode()
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com