|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectptolemy.backtrack.xmlparser.ConfigXmlTree
public class ConfigXmlTree
Tree representation of XML starting from an element.
| Red (tfeng) |
| Red (tfeng) |
| Field Summary | |
|---|---|
private java.util.Hashtable<java.lang.String,java.lang.String> |
_attributes
The hash table of attributes from their names to their values. |
private java.util.Vector<ConfigXmlTree> |
_children
The list of children. |
private java.lang.String |
_elementName
The name of this XML element. |
private java.util.Iterator<ConfigXmlTree> |
_iterator
The iterator used to iterate the children of this node. |
private ConfigXmlTree |
_parent
The parent of this node. null if this node is the root node of the XML document. |
| Constructor Summary | |
|---|---|
ConfigXmlTree(java.lang.String elementName)
Construct a node in the tree with no child. |
|
| Method Summary | |
|---|---|
protected void |
_dump(int indent,
java.io.PrintStream stream)
Print the content of the sub-tree starting from this node to the given output stream in a text format. |
private void |
_dumpString(int indent,
java.lang.String s,
java.io.PrintStream stream)
Print a string to the given output stream in a text format. |
protected void |
_setElementName(java.lang.String elementName)
Set the name of this XML element. |
protected void |
_setParent(ConfigXmlTree parent)
Set the parent of this XML node. |
void |
addChild(ConfigXmlTree child)
Add a child to this node. |
java.lang.Object |
clone()
Clone the sub-tree starting from this node, and return the clone result. |
void |
dump(java.io.PrintStream stream)
Print the content of the sub-tree starting from this node to the given output stream in a text format. |
java.lang.String |
getAttribute(java.lang.String name)
Get the value of the attribute with the given name. |
java.util.Enumeration<java.lang.String> |
getAttributeNames()
Get the names of all the attributes of this XML element. |
java.lang.String |
getElementName()
Get the name of this XML element. |
ConfigXmlTree |
getParent()
Get the parent of this node. |
boolean |
hasAttribute(java.lang.String name)
Test whether this node has an attribute with the given name. |
boolean |
hasMoreChildren()
Test whether there are more children to traverse. |
boolean |
isLeaf()
Test whether this node is a leaf in the XML tree. |
ConfigXmlTree |
nextChild()
Return the next child to be traversed. |
void |
setAttribute(java.lang.String name,
java.lang.String value)
Set the value of the attribute with the given name. |
void |
startTraverseChildren()
Start traversing the children of this node by initializing the internal iterator. |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private java.util.Hashtable<java.lang.String,java.lang.String> _attributes
private java.util.Vector<ConfigXmlTree> _children
private java.lang.String _elementName
private java.util.Iterator<ConfigXmlTree> _iterator
private ConfigXmlTree _parent
| Constructor Detail |
|---|
public ConfigXmlTree(java.lang.String elementName)
elementName - The XML element name of the node.| Method Detail |
|---|
public void addChild(ConfigXmlTree child)
child - The child to be added.public java.lang.Object clone()
clone in class java.lang.Objectpublic void dump(java.io.PrintStream stream)
stream - The stream to be printed to.public java.lang.String getAttribute(java.lang.String name)
name - The attribute name.
setAttribute(String, String)public java.util.Enumeration<java.lang.String> getAttributeNames()
public java.lang.String getElementName()
public ConfigXmlTree getParent()
public boolean hasAttribute(java.lang.String name)
name - The attribute name.
public boolean hasMoreChildren()
nextChild(),
startTraverseChildren()public boolean isLeaf()
public ConfigXmlTree nextChild()
hasMoreChildren(),
startTraverseChildren()
public void setAttribute(java.lang.String name,
java.lang.String value)
name - The attribute name.value - The attribute value.getAttribute(String)public void startTraverseChildren()
hasMoreChildren(),
nextChild()
protected void _dump(int indent,
java.io.PrintStream stream)
indent - The amount of indentation.stream - The stream to be printed to.protected void _setElementName(java.lang.String elementName)
elementName - The element name.protected void _setParent(ConfigXmlTree parent)
addChild(ConfigXmlTree) of the parent.
parent - The parent node.
private void _dumpString(int indent,
java.lang.String s,
java.io.PrintStream stream)
indent - The amount of indentation.s - The string to be printed.stream - The stream to be printed to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||