org.openejb.util
Class StringUtilities

java.lang.Object
  extended by org.openejb.util.StringUtilities

public class StringUtilities
extends java.lang.Object

A simple string utilities class.

Author:
Tim Urberg

Field Summary
static java.lang.String CRLF
          the CRLF for use in String manipulation
 
Method Summary
static java.lang.String blankToNullString(java.lang.String stringToCheckForBlank)
          Checks a String to see if it's blank, and if so returns null (the opposite of nullToBlankString.
static boolean checkNullBlankString(java.lang.String stringToCheck)
          Checks a String to see if it's value is null or blank
static java.lang.String createMethodString(java.lang.reflect.Method method, java.lang.String lineBreak)
          Creates a string representation of a reflection method for example
myMethod(String, String) throws Exception
static java.lang.String getLastToken(java.lang.String tokenString, java.lang.String delimeter)
          Gets the last token in a StringTokenizer.
static java.lang.String nullToBlankString(java.lang.String stringToCheckForNull)
          Checks a String to see if it's value is null, and if so returns a blank string.
static java.lang.String replaceNullOrBlankStringWithNonBreakingSpace(java.lang.String stringToCheckForNull)
          Checks a String to see if it's value is null or blank, and if so returns a non-breaking space.
static java.lang.String stringArrayToCommaDelimitedStringList(java.lang.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 java.lang.String CRLF
the CRLF for use in String manipulation

See Also:
Constant Field Values
Method Detail

getLastToken

public static java.lang.String getLastToken(java.lang.String tokenString,
                                            java.lang.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 java.lang.String nullToBlankString(java.lang.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(java.lang.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 java.lang.String blankToNullString(java.lang.String stringToCheckForBlank)
Checks a String to see if it's blank, and if so returns null (the opposite of nullToBlankString.

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

replaceNullOrBlankStringWithNonBreakingSpace

public static java.lang.String replaceNullOrBlankStringWithNonBreakingSpace(java.lang.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 java.lang.String createMethodString(java.lang.reflect.Method method,
                                                  java.lang.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 java.lang.String stringArrayToCommaDelimitedStringList(java.lang.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-2011 OpenEJB. All Rights Reserved.