nl.liacs.subdisc
Class XMLNode

java.lang.Object
  extended by nl.liacs.subdisc.XMLNode

public class XMLNode
extends java.lang.Object


Method Summary
static org.w3c.dom.Node addNodeTo(org.w3c.dom.Node theParentNode, java.lang.String theElementName)
          Creates and adds a Node to theParentNode.
static void addNodeTo(org.w3c.dom.Node theParentNode, java.lang.String theElementName, java.lang.Object theTextContent)
          Creates and adds a Node to theParentNode.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

addNodeTo

public static org.w3c.dom.Node addNodeTo(org.w3c.dom.Node theParentNode,
                                         java.lang.String theElementName)
Creates and adds a Node to theParentNode. The element name is always converted to lowercase.

Parameters:
theParentNode - the Node to which to add the new Node.
theElementName - the name of the new Node.
Returns:
the newly created Node.

addNodeTo

public static void addNodeTo(org.w3c.dom.Node theParentNode,
                             java.lang.String theElementName,
                             java.lang.Object theTextContent)
Creates and adds a Node to theParentNode. The element name is always converted to lowercase, and for any Object passed in as a parameter its toString() method is used as input String for the setTextContent() method for the new Node. This works fine for build in Java types (eg. Float and Double), but may cause trouble for self defined Objects. In that case override the toString() method for the Object, or pass in a String.

Parameters:
theParentNode - the Node to which to add the new Node.
theElementName - the name of the new Node.
theTextContent - the text content for the new Node.