xmlgp
Class Node

java.lang.Object
  extended by xmlgp.Node

public class Node
extends java.lang.Object

This class is the data holder for Node.
It has setters and getters to all the attributes of Node.

It also has the annotations which will be used by jsefa to deserialize node XML element to node object and to serialize node object to node XML element.

Author:
dharani

Constructor Summary
Node()
           
 
Method Summary
 java.util.List<Node> getChildren()
          Returns the list of children of the node.
 NodeType getType()
          Returns the type of the node.
 java.lang.String getValue()
          Returns the value of the node.
 void setChildren(java.util.List<Node> children)
          Sets the list of children of the node.
 void setLeafNode(NodeType type, java.lang.String value)
          Sets terminal node and sets all attributes at once.
 void setNonTerminalNode(NodeType type, java.lang.String value, java.util.List<Node> children)
          Sets non terminal node and sets all attributes at once.
 void setType(NodeType type)
          Sets the type of the node.
 void setValue(java.lang.String value)
          Sets the value of the node.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Node

public Node()
Method Detail

setNonTerminalNode

public void setNonTerminalNode(NodeType type,
                               java.lang.String value,
                               java.util.List<Node> children)
Sets non terminal node and sets all attributes at once. This method is just for convenience to set all attributes at once instead of setting one by one.

Parameters:
type - the type of the node to set
value - the value of the node to set
children - the list of children to set

setLeafNode

public void setLeafNode(NodeType type,
                        java.lang.String value)
Sets terminal node and sets all attributes at once. This method is just for convenience to set all attributes at once instead of setting one by one.

Parameters:
type - the type of the node to set
value - the value of the node to set

getType

public NodeType getType()
Returns the type of the node.

Returns:
the type of the node

setType

public void setType(NodeType type)
Sets the type of the node.

Parameters:
type - the type of the node to set

getValue

public java.lang.String getValue()
Returns the value of the node.

Returns:
the value of the node

setValue

public void setValue(java.lang.String value)
Sets the value of the node.

Parameters:
value - the value of the node to set

getChildren

public java.util.List<Node> getChildren()
Returns the list of children of the node.

Returns:
the list of children of the node

setChildren

public void setChildren(java.util.List<Node> children)
Sets the list of children of the node.

Parameters:
children - the list of children to set