net.objectlab.qalab.util
Class Util

java.lang.Object
  extended by net.objectlab.qalab.util.Util

public final class Util
extends java.lang.Object

Utility class for list generation and parsing.

Version:
$Revision: 187 $
Author:
Benoit Xhenseval

Method Summary
static java.lang.String getAttributeValue(org.xml.sax.Attributes attrs, java.lang.String attrName, boolean quiet, TaskLogger logger)
          Gets the attribute value.
static java.lang.String getAttributeValue(org.w3c.dom.NamedNodeMap attrs, java.lang.String attrName, boolean quiet, TaskLogger logger)
          Gets the attribute value.
static java.util.List listify(java.lang.String str, java.lang.String delimiter)
          helper method to convert a 'delimiter' separated string to a list.
static java.lang.String listToCSVString(java.util.List list)
          convert a list to a comma separated string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

listify

public static java.util.List listify(java.lang.String str,
                                     java.lang.String delimiter)
helper method to convert a 'delimiter' separated string to a list.

Parameters:
str - the 'delimiter' separated string
delimiter - typically a ','
Returns:
a list

listToCSVString

public static java.lang.String listToCSVString(java.util.List list)
convert a list to a comma separated string.

Parameters:
list - list to "print"
Returns:
a String comma separated.

getAttributeValue

public static java.lang.String getAttributeValue(org.xml.sax.Attributes attrs,
                                                 java.lang.String attrName,
                                                 boolean quiet,
                                                 TaskLogger logger)
Gets the attribute value.

Parameters:
attrs - SAX XML attributes.
attrName - attribute name
quiet - if true, no logging
logger - the logger to use
Returns:
String the attribute value

getAttributeValue

public static java.lang.String getAttributeValue(org.w3c.dom.NamedNodeMap attrs,
                                                 java.lang.String attrName,
                                                 boolean quiet,
                                                 TaskLogger logger)
Gets the attribute value.

Parameters:
attrs - DOM XML attributes.
attrName - attribute name
quiet - if true, no logging
logger - the logger to use
Returns:
String the attribute value