org.apache.poi.xwpf.converter.core.utils
Class StringUtils

java.lang.Object
  extended by org.apache.poi.xwpf.converter.core.utils.StringUtils

public class StringUtils
extends Object

String Utilities.


Field Summary
static String[] EMPTY_STRING_ARRAY
           
 
Constructor Summary
StringUtils()
           
 
Method Summary
static boolean isEmpty(String str)
           Checks if a String is empty ("") or null.
static boolean isNotEmpty(String str)
           Checks if a String is not empty ("") and not null.
static String replaceAll(String line, String oldString, String newString)
          Replace the oldString by the newString in the line and returns the result.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY_STRING_ARRAY

public static final String[] EMPTY_STRING_ARRAY
Constructor Detail

StringUtils

public StringUtils()
Method Detail

isEmpty

public static boolean isEmpty(String str)

Checks if a String is empty ("") or null.

 StringUtils.isEmpty(null) = true StringUtils.isEmpty("") = true
 StringUtils.isEmpty(" ") = false StringUtils.isEmpty("bob") = false
 StringUtils.isEmpty(" bob ") = false
 

Parameters:
str - the String to check, may be null
Returns:
true if the String is empty or null

isNotEmpty

public static boolean isNotEmpty(String str)

Checks if a String is not empty ("") and not null.

 StringUtils.isNotEmpty(null) = false
 StringUtils.isNotEmpty("") = false
 StringUtils.isNotEmpty(" ") = true
 StringUtils.isNotEmpty("bob") = true
 StringUtils.isNotEmpty(" bob ") = true
 

Parameters:
str - the String to check, may be null
Returns:
true if the String is not empty and not null

replaceAll

public static final String replaceAll(String line,
                                      String oldString,
                                      String newString)
Replace the oldString by the newString in the line and returns the result.

Parameters:
line - the line to replace.
oldString - old token to replace.
newString - new token to replace.
Returns:


Copyright © 2013. All rights reserved.