SNMP Stack 4_12

uk.co.westhawk.test
Class Util

java.lang.Object
  |
  +--uk.co.westhawk.test.Util

public class Util
extends java.lang.Object

The class Util contains utility methods for DOM nodes.

Version:
$Revision: 1.5 $ $Date: 2002/10/22 16:56:14 $
Author:
Birgit Arkesteijn

Constructor Summary
Util()
           
 
Method Summary
static java.lang.String getCDataValue(org.w3c.dom.Node node, java.lang.String tag)
          Returns the CDATA value of the subnode of specified node with the specified tag.
static org.w3c.dom.Node getChildNode(org.w3c.dom.Node node, java.lang.String tag)
          Return the child node of the specified node with the specified tag.
static org.w3c.dom.Node getTopElementNode(org.w3c.dom.Document doc)
          Returns the first element node of a document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Util

public Util()
Method Detail

getCDataValue

public static java.lang.String getCDataValue(org.w3c.dom.Node node,
                                             java.lang.String tag)
Returns the CDATA value of the subnode of specified node with the specified tag. For example:
     <test>
        <host>localhost<host>
     </test>
 
would return localhost, for node being the test node and tag being host.
Parameters:
node - The parent DOM node
tag - The tag of the node
Returns:
the value

getChildNode

public static org.w3c.dom.Node getChildNode(org.w3c.dom.Node node,
                                            java.lang.String tag)
Return the child node of the specified node with the specified tag.
Parameters:
node - The parent DOM node
tag - The tag of the node
Returns:
the child node

getTopElementNode

public static org.w3c.dom.Node getTopElementNode(org.w3c.dom.Document doc)
Returns the first element node of a document.
Parameters:
doc - The DOM document.
Returns:
the node

SNMP Stack 4_12