|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.jdo.spi.persistence.utility.StringHelper
public class StringHelper
NOTE: These utilities have been moved from another (more specific package's) utility class so that more classes can have access to them. There can be some refactoring work to combine these with some of the methods in the StringScanner class.
| Constructor Summary | |
|---|---|
StringHelper()
|
|
| Method Summary | |
|---|---|
static java.lang.String |
arrayToSeparatedList(java.util.List list)
Convert an array of objects into a separated string using the default separator and the entire array. |
static java.lang.String |
arrayToSeparatedList(java.util.List list,
int beginIndex,
int endIndex)
Convert an array of objects into a separated string using the default separator. |
static java.lang.String |
arrayToSeparatedList(java.util.List list,
int beginIndex,
int endIndex,
java.lang.String separator)
Convert an array of objects into a separated string. |
static java.lang.String |
arrayToSeparatedList(java.util.List list,
java.lang.String separator)
Convert an array of objects into a separated string using the specified separator and the entire array. |
static java.lang.String |
escape(java.lang.String str)
Escaping given string by " and \. |
static java.lang.String |
getCapitalizedString(java.lang.String aString)
Gets a version of the specified string with the first letter capitalized. |
static java.lang.String |
intArrayToSeparatedList(int[] intArray,
int beginIndex,
int endIndex,
java.lang.String separator)
Convert an array of int values into a separated string. |
static java.lang.String |
intArrayToSeparatedList(int[] intArray,
java.lang.String separator)
Convert an array of int values into a separated string. |
static boolean |
isEmpty(java.lang.String aString)
Checks if a string is null or empty. |
static java.lang.String |
replace(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
Replaces all occurences of oldString in string
with newString. |
static java.lang.String |
replaceFirst(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
Replaces the first occurence of oldString in string
with newString. |
static java.lang.String |
rtrim(java.lang.String input)
Trims trailing spaces from input. |
static java.util.List |
separatedListToArray(java.lang.String list)
Convert a separated string to an array of strings using the default separator. |
static java.util.List |
separatedListToArray(java.lang.String list,
java.lang.String separator)
Convert a separated string to an array of strings |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StringHelper()
| Method Detail |
|---|
public static java.lang.String arrayToSeparatedList(java.util.List list,
int beginIndex,
int endIndex,
java.lang.String separator)
list - The list of objects to be expanded.beginIndex - The index of the first element in the list to be used.endIndex - The index of the last element in the list to be used.separator - The separator to be used between strings.
public static java.lang.String arrayToSeparatedList(java.util.List list,
int beginIndex,
int endIndex)
list - The list of objects to be expanded.beginIndex - The index of the first element in the list to be used.endIndex - The index of the last element in the list to be used.
public static java.lang.String arrayToSeparatedList(java.util.List list,
java.lang.String separator)
list - The list of objects to be expanded.separator - The separator to be used between strings.
public static java.lang.String arrayToSeparatedList(java.util.List list)
list - The list of objects to be expanded.
public static java.util.List separatedListToArray(java.lang.String list,
java.lang.String separator)
list - The string representing the list of objects.separator - The separator to be used to tokenize strings.
public static java.util.List separatedListToArray(java.lang.String list)
list - The string representing the list of objects.
public static java.lang.String intArrayToSeparatedList(int[] intArray,
java.lang.String separator)
intArray - The array of int values to be expanded.separator - The separator to be used between strings.
public static java.lang.String intArrayToSeparatedList(int[] intArray,
int beginIndex,
int endIndex,
java.lang.String separator)
intArray - The array of int values to be expanded.beginIndex - The index of the first element in the array to be used.endIndex - The index of the last element in the array to be used.separator - The separator to be used between strings.
public static boolean isEmpty(java.lang.String aString)
true if the string is null or empty after trim,
false otherwirse.public static java.lang.String getCapitalizedString(java.lang.String aString)
aString - the string to be capitalized
public static java.lang.String replaceFirst(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
oldString in string
with newString. The methods returns either a new string
instance (in the case oldString is included in the string)
or the origial string itself (in the case oldString is not
included).
string - the original string.oldString - the string to be replaced.newString - the string the old value is replaced with.
public static java.lang.String replace(java.lang.String string,
java.lang.String oldString,
java.lang.String newString)
oldString in string
with newString. The methods returns either a new string
instance (in the case oldString is included in the string)
or the origial string itself (in the case oldString is not
included).
string - the original string.oldString - the string to be replaced.newString - the string the old value is replaced with.
public static java.lang.String rtrim(java.lang.String input)
input - The input string.
input.public static java.lang.String escape(java.lang.String str)
str - String to be escaped
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||