org.gswing.utils.xml
Class XNode

java.lang.Object
  extended by org.gswing.utils.xml.XNode

public class XNode
extends Object

This is the data structure for xml data tree Fields : String tagName - The name of the current tag (node) String text - The text contained in the node (node value) Properties attributes - the attributes of the tag as Properties You can get the attribute names and values by accessing the properties keys and values. ArrayList childNodes - This is another XNode. This structure makes up a tree of XNodes Traverse recursively.

Version:
0.1, 08/06/2005
Author:
Prajeesh Kumar P

Constructor Summary
XNode()
           
 
Method Summary
 void addChildNode(Object node)
          Add a child to this node.
 Object getChildNode(int index)
          Get the child node at this position.
 int getNoChildNodes()
          Get the number of child nodes belonging to this node.
 String getPropertyValue(String name)
          Get the current value of a property.
 String getTagName()
          Get the nodes tag name.
 String getText()
          Get node text.
 void setPropertyValue(String key, String value)
          Set the valuie of a property.
 void setTagName(String tagName)
          Set the tage name.
 void setText(String text)
          Set node text.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XNode

public XNode()
Method Detail

getNoChildNodes

public int getNoChildNodes()
Get the number of child nodes belonging to this node.

Returns:
The number of childNodes.

getChildNode

public Object getChildNode(int index)
Get the child node at this position.

Parameters:
index - the child list index.

addChildNode

public void addChildNode(Object node)
Add a child to this node.

Parameters:
node - The node to add.

getTagName

public String getTagName()
Get the nodes tag name.

Returns:
The tagName.

setTagName

public void setTagName(String tagName)
Set the tage name.

Parameters:
tagName - The node's tag name.

getPropertyValue

public String getPropertyValue(String name)
Get the current value of a property.

Parameters:
name - The property key.
Returns:
The properrty value.

setPropertyValue

public void setPropertyValue(String key,
                             String value)
Set the valuie of a property.

Parameters:
key - The property key.
value - The new value.

getText

public String getText()
Get node text.

Returns:
The node text.

setText

public void setText(String text)
Set node text.

Parameters:
text - The node text.


Copyright © 2008. All Rights Reserved.