|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecterland.util.XMLNode
public class XMLNode
A node object for an XML document tree. An object of this class represents a node and all its child nodes
Constructor Summary | |
---|---|
XMLNode(String name,
Map attributes)
Creates a new empty XML node |
Method Summary | |
---|---|
void |
addChild(XMLNode node)
Add a child node |
void |
delChild(String name)
Delete the first child node matching the name If the child node has child nodes itself these will also be deleted. |
void |
delChild(XMLNode node)
Delete a child node. |
void |
delChilds()
Delete all child nodes. |
Iterator |
getAttributes()
Get an iterator with the name of all attributes for the node |
String |
getAttributeValue(String attribute)
Get the value of a specified attribute for the node |
Iterator |
getChilds()
Get all child nodes |
String |
getName()
Get the name of this node |
String |
getValue()
Get the value of this node |
void |
insertChild(XMLNode node)
Insert a child node |
void |
replaceChild(XMLNode currentNode,
XMLNode newNode)
Replaces an existing child node with a new one |
void |
setAttributeValue(String name,
String value)
Set the value of a specified attribute for the node |
void |
setName(String name)
Set the name of this node |
void |
setValue(String value)
Set the value of this node |
String |
toString()
Get a string representation of the XML node and all its child nodes |
String |
toString(boolean lineFeeds)
Get a string representation of the XML node and all its child nodes. |
String |
toString(boolean lineFeeds,
boolean preprocessor)
Get a string representation of the XML node and all its child nodes. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public XMLNode(String name, Map attributes)
name
- The name of the nodeattributes
- The value of the attribute strings for the node, set to null if no attributes existMethod Detail |
---|
public void setName(String name)
name
- The name of the nodepublic String getName()
public String getValue()
public void setValue(String value)
value
- The value of the nodepublic Iterator getAttributes()
public String getAttributeValue(String attribute)
attribute
- The name of the attribute to get
public void setAttributeValue(String name, String value)
name
- The name of the attribute to setvalue
- The value of the attributepublic Iterator getChilds()
public void addChild(XMLNode node)
node
- The child node to addpublic void replaceChild(XMLNode currentNode, XMLNode newNode)
currentNode
- The current child not which should be replacednewNode
- The new child node which is should be replaced withpublic void insertChild(XMLNode node)
node
- The child node to insertpublic void delChild(XMLNode node)
node
- The child node which should be deleteddelChild(String)
public void delChilds()
delChild(String)
,
delChild(XMLNode)
public void delChild(String name)
name
- The name of the child node which should be deleteddelChild(XMLNode)
public String toString()
toString
in class Object
public String toString(boolean lineFeeds)
lineFeeds
- Indicates that each node should be printed on its own line
public String toString(boolean lineFeeds, boolean preprocessor)
lineFeeds
- Indicates that each node should be printed on its own linepreprocessor
- Indicates that a preprocessor directive should be printed at the beginning
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |