irssibot.util
Class XMLUtil

java.lang.Object
  |
  +--irssibot.util.XMLUtil

public class XMLUtil
extends java.lang.Object

Collection of util functions for manipulating and parsing XML documents.

Version:
$Name: $ $Revision: 1.3 $
Author:
Matti Dahlbom

Constructor Summary
XMLUtil()
           
 
Method Summary
static java.util.Vector getListElements(org.w3c.dom.Node listNode, java.lang.String listElementName)
          Used to parse out elements of a list such as this:
static java.lang.String getNodeAttribute(org.w3c.dom.Node node, java.lang.String name)
          Returns the value of a named node's attribute.
static int getNodeIntAttribute(org.w3c.dom.Node node, java.lang.String name)
          Returns the value of a named node's attribute as an integer.
static java.lang.String getTextChildValue(org.w3c.dom.Node node)
          Returns a text node contents below given node:
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLUtil

public XMLUtil()
Method Detail

getListElements

public static java.util.Vector getListElements(org.w3c.dom.Node listNode,
                                               java.lang.String listElementName)
Used to parse out elements of a list such as this:

 
    value1
    value2
    value3
 
 

For this example, called with Node pointing to element and "element" in listElementName.

Parameters:
listNode - pointer to list's "root" node
listElementName - name of list element
Returns:
Vector of list elements

getTextChildValue

public static java.lang.String getTextChildValue(org.w3c.dom.Node node)
Returns a text node contents below given node:

 text to be returned
 

Parameters:
node - node whose text child to return
Returns:
text node contents or null if no such child

getNodeAttribute

public static java.lang.String getNodeAttribute(org.w3c.dom.Node node,
                                                java.lang.String name)
Returns the value of a named node's attribute.

Parameters:
node - node whose attribute to return
name - name of attribute to return
Returns:
attribute value or null if not found

getNodeIntAttribute

public static int getNodeIntAttribute(org.w3c.dom.Node node,
                                      java.lang.String name)
Returns the value of a named node's attribute as an integer.

Parameters:
node - node whose attribute to return
name - name of attribute to return
Returns:
attribute value or null if not found
Throws:
MissingValueException - if the value is missing


IrssiBot (c) 2000-2002 Matti Dahlbom