public class NodeImpl extends net.n3.nanoxml.XMLElement implements Node
Constructor and Description |
---|
NodeImpl()
Create a new instance of NodeImpl.
|
NodeImpl(java.lang.String nodeName)
Create a new instance of NodeImpl.
|
NodeImpl(java.lang.String fullName,
java.lang.String namespace)
Creates a new instance of NodeImpl.
|
NodeImpl(java.lang.String fullName,
java.lang.String systemID,
int lineNr)
Creates a new instance of ElementImpl.
|
NodeImpl(java.lang.String fullName,
java.lang.String namespace,
java.lang.String systemID,
int lineNr)
Creates a new instance of NodeImpl.
|
Modifier and Type | Method and Description |
---|---|
void |
addChild(Node childNode)
Add a child node to this node.
|
void |
addContent(int position,
Node childNode)
Add the child node to this node at the specified position.
|
void |
addContent(Node childNode)
Add the child node to this node.
|
java.lang.Object |
clone()
Return a deep copy of this node, including copies of all sub-nodes.
|
Node |
detach()
Detach this node from its parent node.
|
Element |
getChild(java.lang.String nodeName)
Get the first child node with the specified name.
|
java.util.Vector<Node> |
getChildren()
Get the child nodes of this node.
|
int |
getChildrenCount()
Get the number of child nodes.
|
java.lang.String |
getValue()
Get the node value.
|
boolean |
hasChildren()
Return true if this node has child nodes.
|
boolean |
removeChild(java.lang.String nodeName)
Remove the first child node with the specified name.
|
void |
setValue(java.lang.String theValue)
Set the node value.
|
addChild, createElement, createElement, createElement, createElement, createPCDataElement, enumerateAttributeNames, enumerateChildren, equals, equalsXMLElement, finalize, getAttribute, getAttribute, getAttribute, getAttribute, getAttribute, getAttributeCount, getAttributeNamespace, getAttributes, getAttributesInNamespace, getAttributeType, getAttributeType, getChildAtIndex, getChildrenNamed, getChildrenNamed, getContent, getFirstChildNamed, getFirstChildNamed, getFullName, getLineNr, getName, getNamespace, getParent, getSystemID, hasAttribute, hasAttribute, insertChild, isLeaf, removeAttribute, removeAttribute, removeChild, removeChildAtIndex, setAttribute, setAttribute, setContent, setName, setName
public NodeImpl()
public NodeImpl(java.lang.String nodeName)
nodeName
- the node name.public NodeImpl(java.lang.String fullName, java.lang.String namespace)
fullName
- the full name of the elementnamespace
- the namespace symbol.public NodeImpl(java.lang.String fullName, java.lang.String systemID, int lineNr)
fullName
- the full name of the elementsystemID
- the system ID of the XML data where the element starts.lineNr
- the line in the XML data where the element starts.public NodeImpl(java.lang.String fullName, java.lang.String namespace, java.lang.String systemID, int lineNr)
fullName
- the full name of the elementnamespace
- the namespace URI.systemID
- the system ID of the XML data where the element starts.lineNr
- the line in the XML data where the element starts.public void setValue(java.lang.String theValue)
public java.lang.String getValue()
public boolean hasChildren()
hasChildren
in interface net.n3.nanoxml.IXMLElement
hasChildren
in interface Node
hasChildren
in class net.n3.nanoxml.XMLElement
public int getChildrenCount()
getChildrenCount
in interface net.n3.nanoxml.IXMLElement
getChildrenCount
in interface Node
getChildrenCount
in class net.n3.nanoxml.XMLElement
public void addChild(Node childNode)
public Element getChild(java.lang.String nodeName)
public java.util.Vector<Node> getChildren()
getChildren
in interface net.n3.nanoxml.IXMLElement
getChildren
in interface Node
getChildren
in class net.n3.nanoxml.XMLElement
public boolean removeChild(java.lang.String nodeName)
removeChild
in interface Node
nodeName
- the name of the node to remove.public void addContent(Node childNode)
addContent
in interface Node
childNode
- the node to add as a child node.public void addContent(int position, Node childNode)
addContent
in interface Node
position
- the position at which to add the child node.childNode
- the node to add as a child node.public Node detach()