public class XMLDocuNode extends java.lang.Object implements java.lang.Iterable<XMLDocuNode>
Constructor and Description |
---|
XMLDocuNode(java.lang.String name)
Creates a new
XMLDocuNode with the specified name. |
Modifier and Type | Method and Description |
---|---|
void |
addChildNode(XMLDocuNode node)
Adds a new child node.
|
java.lang.String |
getAttribute(java.lang.String attributeName) |
java.util.Map<java.lang.String,java.lang.String> |
getAttributes()
Returns a Map of all attribute names and values which are defined for this element.
|
int |
getChildCount()
Returns the number of Child elements.
|
java.lang.String |
getNodeName()
Returns the name of this node.
|
java.lang.String |
getValue()
Returns the value of this node or an empty String if not set.
|
boolean |
hasChildNodes() |
java.util.Iterator<XMLDocuNode> |
iterator()
Iterator which returns all child nodes.
|
void |
removeAttribute(java.lang.String name)
Removes Attribute from node.
|
void |
removeAttribute(java.lang.String name,
java.lang.String value)
Deprecated.
call the method without value because it is ignored
|
void |
removeChildNodes()
Removes all child nodes.
|
void |
setAttribute(java.lang.String name,
java.lang.String value)
Sets the value of an attribute.
|
void |
setValue(java.lang.String value)
Sets the value of this node.
|
public XMLDocuNode(java.lang.String name)
XMLDocuNode
with the specified name.name
- Name of the node in the treepublic java.lang.String getAttribute(java.lang.String attributeName)
attributeName
- Name of the attributepublic java.util.Map<java.lang.String,java.lang.String> getAttributes()
public void setAttribute(java.lang.String name, java.lang.String value)
name
- Namevalue
- Value@Deprecated public void removeAttribute(java.lang.String name, java.lang.String value)
name
- Attribute Namevalue
- Attribute Valuepublic void removeAttribute(java.lang.String name)
name
- Attribute Namepublic int getChildCount()
public void setValue(java.lang.String value)
value
- Node valuepublic java.lang.String getNodeName()
public java.lang.String getValue()
public void addChildNode(XMLDocuNode node)
node
- Child Nodepublic boolean hasChildNodes()
public void removeChildNodes()
public java.util.Iterator<XMLDocuNode> iterator()
iterator
in interface java.lang.Iterable<XMLDocuNode>