org.exolab.castor.types
public final class AnyNode extends Object implements Serializable
Version: $Revision: 1.2 $ $Date: 2005/03/05 13:41:56 $
UNKNOWN: Processing Instructions Full handling of namespaces
Field Summary | |
---|---|
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 Summary | |
---|---|
AnyNode()
Default constructor: creates an empty element node | |
AnyNode(short type, String localName, String prefix, String uri, String value)
Creates a node given all the necessary information:
type, localName, prefix, uri and value.
|
Method Summary | |
---|---|
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.
|
String | getLocalName()
Returns the local name of the node.
|
String | getNamespacePrefix()
Returns the namespace prefix associated with the namespace URI of
this node.
|
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. |
String | getStringValue()
Returns the string value of the node. |
String | toString()
Returns the String representation of this AnyNode
The String representation is a xml well-formed fragment corresponding
to the representation of this node. |
Parameters: 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.
Parameters: node the node to append
Parameters: node the attribute to add.
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.
Parameters: node the node to add.
Parameters: node the attribute to add.
Parameters: node the node to add
Returns: the first child of this node
Returns: the first child node in the tree.
Returns: The local name of the node, or null if the node has no name
Returns: The namespace prefix, or null
Returns: The namespace URI of the node, or null if the node has no namespace URI
Returns: the next sibling of the current node
Returns: The type of this node
Returns: The string value of the node