com.bea.tuxedo.control
Class StringUtil

java.lang.Object
  extended by com.bea.tuxedo.control.StringUtil

public class StringUtil
extends Object

This class contains utility methods for dealing with Strings.


Constructor Summary
StringUtil()
           
 
Method Summary
static boolean endsWithIgnoreCase(String str, String suffix)
          Determines whether the given string ends with the given suffix, ignoring the case of the letters.
static String escapeXMLText(String input)
           
static boolean isEmpty(String s)
          Determines whether or not the string is empty or null.
static String join(List parts, char delim)
          Returns a string containing the given pieces glued together with the given delimiter in between.
static String join(String[] parts, char delim)
           
static String lCaseFirstLetter(String str)
           
static List split(String str, char delim)
          Returns a list containing the parts of the string that are separated by the given delimiter.
static List split(String str, char delim, boolean fTrim, List parts)
           
static String trimQuotes(String string)
           
static String truncate(String str, int len)
           
static String truncateString(String input, int width, Component c)
          gets a shorter version of the given string, no wider than width when rendered in c's default font.
static String truncateString(String input, int width, FontMetrics fm)
          gets a shorter version of the given string, no wider than width when rendered in fm metrics.
static String uCaseFirstLetter(String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtil

public StringUtil()
Method Detail

split

public static List split(String str,
                         char delim)
Returns a list containing the parts of the string that are separated by the given delimiter.


split

public static List split(String str,
                         char delim,
                         boolean fTrim,
                         List parts)

join

public static String join(List parts,
                          char delim)
Returns a string containing the given pieces glued together with the given delimiter in between.


join

public static String join(String[] parts,
                          char delim)

isEmpty

public static boolean isEmpty(String s)
Determines whether or not the string is empty or null.


endsWithIgnoreCase

public static boolean endsWithIgnoreCase(String str,
                                         String suffix)
Determines whether the given string ends with the given suffix, ignoring the case of the letters.


lCaseFirstLetter

public static String lCaseFirstLetter(String str)

uCaseFirstLetter

public static String uCaseFirstLetter(String str)

trimQuotes

public static String trimQuotes(String string)

truncate

public static String truncate(String str,
                              int len)

truncateString

public static String truncateString(String input,
                                    int width,
                                    Component c)
gets a shorter version of the given string, no wider than width when rendered in c's default font.


truncateString

public static String truncateString(String input,
                                    int width,
                                    FontMetrics fm)
gets a shorter version of the given string, no wider than width when rendered in fm metrics. this will return null only if the original input is null.


escapeXMLText

public static String escapeXMLText(String input)