org.openejb.util
Class StringUtilities

java.lang.Object
  extended byorg.openejb.util.StringUtilities

public class StringUtilities
extends Object

A simple string utilities class.


Field Summary
static String CRLF
          the CRLF for use in String manipulation
 
Method Summary
static String blankToNullString(String stringToCheckForBlank)
          Checks a String to see if it's blank, and if so returns null (the opposite of nullToBlankString.
static boolean checkNullBlankString(String stringToCheck)
          Checks a String to see if it's value is null or blank
static String createMethodString(Method method, String lineBreak)
          Creates a string representation of a reflection method for example
myMethod(String, String) throws Exception
static String getLastToken(String tokenString, String delimeter)
          Gets the last token in a StringTokenizer.
static String nullToBlankString(String stringToCheckForNull)
          Checks a String to see if it's value is null, and if so returns a blank string.
static String replaceNullOrBlankStringWithNonBreakingSpace(String stringToCheckForNull)
          Checks a String to see if it's value is null or blank, and if so returns a non-breaking space.
static String stringArrayToCommaDelimitedStringList(String[] stringArray)
          Changes a string array into a comma delimted list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CRLF

public static final String CRLF
the CRLF for use in String manipulation

See Also:
Constant Field Values
Method Detail

getLastToken

public static String getLastToken(String tokenString,
                                  String delimeter)
Gets the last token in a StringTokenizer.

Parameters:
tokenString - - the string to get the last token from
delimeter - - the delimeter of the string
Returns:
the last token or null if there are none

nullToBlankString

public static String nullToBlankString(String stringToCheckForNull)
Checks a String to see if it's value is null, and if so returns a blank string.

Parameters:
stringToCheckForNull - - the string to check for null
Returns:
the checked string

checkNullBlankString

public static boolean checkNullBlankString(String stringToCheck)
Checks a String to see if it's value is null or blank

Parameters:
stringToCheck - - the string to check for blank or null
Returns:
whether blank or null

blankToNullString

public static String blankToNullString(String stringToCheckForBlank)
Checks a String to see if it's blank, and if so returns null (the opposite of nullToBlankString.

Returns:
the checked string or null

replaceNullOrBlankStringWithNonBreakingSpace

public static String replaceNullOrBlankStringWithNonBreakingSpace(String stringToCheckForNull)
Checks a String to see if it's value is null or blank, and if so returns a non-breaking space.

Parameters:
stringToCheckForNull - - the string to check for null or blank
Returns:
the checked string

createMethodString

public static String createMethodString(Method method,
                                        String lineBreak)
Creates a string representation of a reflection method for example
myMethod(String, String) throws Exception

Parameters:
method - - the reflection method
lineBreak - - the type of line break usually \n or <br>
Returns:
the string representation of the method

stringArrayToCommaDelimitedStringList

public static String stringArrayToCommaDelimitedStringList(String[] stringArray)
Changes a string array into a comma delimted list

Parameters:
stringArray - - The string array to be converted
Returns:
the comma delimted list


Copyright © 1999-2006 OpenEJB. All Rights Reserved.