org.jbeans.util
Class StringTools

java.lang.Object
  |
  +--org.jbeans.util.StringTools

public class StringTools
extends Object

This class is a toolkit designed to help with string opertaions in other classes. This class is in the util package because it really has no value to the outside world in terms of JavaBeans. It is only used to make life easy for the JavaBean classes.

Although, this class is used heavily in other projects by copying the code to a new class specific to that project. Therefore, putting it in the util package here will allow for the org.jbeans package to be entirely (org.jbeans.*) included without causing name conflict issues.

Regardless, this is it's home for now.

Author:
Brian Pontarelli

Method Summary
static String cleanString(String str)
          Returns the value of the string or if the string is null, it returns an empty String
static boolean isEmpty(String str)
          Returns true if the string pass in is null or empty
static boolean isTrimmedEmpty(String str)
          Returns true if the string pass in is null or empty or trimmed and empty
static boolean isValidBoolean(String str)
          Returns true if the string is a valid boolean expression according to the valueOf method on java.lang.Boolean, false otherwise
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEmpty

public static boolean isEmpty(String str)
Returns true if the string pass in is null or empty

isTrimmedEmpty

public static boolean isTrimmedEmpty(String str)
Returns true if the string pass in is null or empty or trimmed and empty

isValidBoolean

public static boolean isValidBoolean(String str)
Returns true if the string is a valid boolean expression according to the valueOf method on java.lang.Boolean, false otherwise

cleanString

public static String cleanString(String str)
Returns the value of the string or if the string is null, it returns an empty String