public class XMLDocuNode extends Object implements Iterable<XMLDocuNode>
Constructor and Description |
---|
XMLDocuNode(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.
|
String |
getAttribute(String attributeName) |
Map<String,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.
|
String |
getNodeName()
Returns the name of this node.
|
String |
getValue()
Returns the value of this node or an empty String if not set.
|
boolean |
hasChildNodes() |
Iterator<XMLDocuNode> |
iterator()
Iterator which returns all child nodes.
|
void |
removeAttribute(String name,
String value)
Removes Attribute from node.
|
void |
removeChildNodes()
Removes all child nodes.
|
void |
setAttribute(String name,
String value)
Sets the value of an attribute.
|
void |
setValue(String value)
Sets the value of this node.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public XMLDocuNode(String name)
XMLDocuNode
with the specified name.name
- Name of the node in the treepublic String getAttribute(String attributeName)
attributeName
- Name of the attributepublic Map<String,String> getAttributes()
public void setAttribute(String name, String value)
name
- Namevalue
- Valuepublic void removeAttribute(String name, String value)
name
- Attribute Namevalue
- Attribute Valuepublic int getChildCount()
public void setValue(String value)
value
- Node valuepublic String getNodeName()
public String getValue()
public void addChildNode(XMLDocuNode node)
node
- Child Nodepublic boolean hasChildNodes()
public void removeChildNodes()
public Iterator<XMLDocuNode> iterator()
iterator
in interface Iterable<XMLDocuNode>
Copyright © 2021. All rights reserved.