|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amx.duet.tools.xml.XMLNode
The XMLNode
class was created to store the contents of XML files into
Tag
and Attribute
objects, but it could also be used to
store tag information for HTML tags and other user defined tags.
The XMLNode can be traversed foward by looping through the list of nodes
stored at the root, then looping through the individual nodes until null is
reached. An XMLNode can also be traversed top-down using the getParent()
method until null is reached, which signifies the "root" level.
A Tag
is stored at the base level of each XMLNode in the list
Constructor Summary | |
XMLNode()
|
|
XMLNode(XMLNode nodeParent,
Tag data)
Creates an XML node object with the passed in Tag as its data |
Method Summary | |
void |
addNode(XMLNode node)
Adds and entire sub tree as a leaf to the current node |
XMLNode |
addTag(XMLNode nodeParent,
Tag tag)
Takes the passed in Tag and adds it adds a leaf to the current node. |
void |
clear()
Clear all of the nodes listed for this node |
void |
dump()
Outputs all of the node data to the print stream |
XMLNode |
getAbsoluteRoot()
Retrieves the absolute root node of the entire node tree no matter where current node's position is. |
Tag |
getData()
Retrieves the first Tag object from this node |
int |
getDebugState()
Gets the current diagnostic state. |
XMLNode |
getNextNode(java.lang.String name)
Recursive search through the node leaves for the matching named tag |
XMLNode |
getNextNode(Tag tag)
Recursive search through the node leaves for the matching tag |
Tag |
getNextTag(java.lang.String name)
Recursive search through the node leaves for the matching named tag |
XMLNode |
getNode(int index)
Search through nodes on the same level as this leaf at this index |
XMLNode |
getNode(java.lang.String name)
Search through nodes on the current level for a matching tag name. |
XMLNode |
getNode(Tag tag)
Search through nodes on the current level for a matching tag. |
java.util.Vector |
getNodeList(java.lang.String name)
Retrieve a list of nodes at this level of the tree that match the node name |
java.util.Vector |
getNodes()
Retrieve the entire list of nodes for this tag |
XMLNode |
getParent()
Retrieve the parent node for this node. |
XMLNode |
getRoot()
Retrieves the root node of the entire node tree no matter where current node's position is. |
Tag |
getTag(int index)
Search through nodes on the same level as this tag at this index |
Tag |
getTag(java.lang.String name)
Search through nodes on the same level as the matching named tag |
void |
setDebug(boolean bState)
Deprecated. Do not use this method; use setDebugState instead |
void |
setDebugState(int nState)
Puts the class into a debug diagnostic state. |
int |
size()
Retrieve the number of nodes for this tag |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public XMLNode()
public XMLNode(XMLNode nodeParent, Tag data)
data
- the first object in the nodeMethod Detail |
public void addNode(XMLNode node)
node
- an XMLNode object containing its own tags and nodespublic XMLNode addTag(XMLNode nodeParent, Tag tag)
tag
- an XML Tag object
public XMLNode getNode(int index)
index
- position of the leaf at this level
public XMLNode getNode(java.lang.String name)
name
-
public XMLNode getNode(Tag tag)
tag
-
public XMLNode getRoot()
Note: This method does not retrieve the actual root node, instead it
retrieves the node stored in the root node, which was the first node that was added
to the tree. If for any reason you require the actual root node, you can call
getParent()
or getAbsoluteRoot()
.
public XMLNode getAbsoluteRoot()
Note: This method is rarely used. Use getRoot()
instead.
public Tag getTag(int index)
index
- position of the tag at this level
public Tag getTag(java.lang.String name)
name
- of tag to search for
public Tag getNextTag(java.lang.String name)
name
- of tag to search for
public XMLNode getNextNode(java.lang.String name)
name
- of tag to search for
public java.util.Vector getNodeList(java.lang.String name)
name
- of tag to search for
public XMLNode getNextNode(Tag tag)
tag
- the Tag to search for
public XMLNode getParent()
public Tag getData()
public java.util.Vector getNodes()
public int size()
public void clear()
public void dump()
public void setDebug(boolean bState)
bState
- public void setDebugState(int nState)
nState
- public int getDebugState()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |