|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jetspeed.util.StringUtils
This class provides static util methods for String manaipulation that aren't part of the default JDK functionalities.
Constructor Summary | |
StringUtils()
|
Method Summary | |
static java.lang.String |
arrayToString(java.lang.String[] array,
java.lang.String separators)
Takes an array of tokens and converts into separator-separated string. |
static java.lang.String |
removeChars(java.lang.String data,
java.lang.String removeChars)
Remove a given set of characters from a String. |
static java.lang.StringBuffer |
replaceAll(java.lang.StringBuffer buffer,
java.lang.String find,
java.lang.String replacement)
Replaces all the occurences of a substring found within a StringBuffer by a replacement string |
static java.lang.String |
replaceAll(java.lang.String original,
java.lang.String find,
java.lang.String replacement)
Deprecated. (Generates too much garbage) |
static java.lang.String |
replaceVars(java.lang.String origString,
java.util.Map vars)
Performs variable substitution for a string. |
static java.util.Map |
sortMapByValue(java.util.Map map)
Returns map sorted by value |
static java.util.ArrayList |
splitString(java.lang.String list,
java.lang.String separator)
Converts separated list into an array list |
static java.util.Map |
splitStringPairs(java.lang.String list,
java.lang.String separator,
java.lang.String pairSeparator)
Converts separated list of pairs into an array list |
static java.util.Map |
splitStringPairs(java.lang.String list,
java.lang.String separator,
java.lang.String pairSeparator,
boolean sortByValue)
Same as splitStringPairs but returnes a sequenced map sorted by entry value |
static java.lang.String[] |
stringToArray(java.lang.String str,
java.lang.String separators)
Converts a delimited string into an array of string tokens. |
static java.lang.String |
stripExtension(java.lang.String filename)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StringUtils()
Method Detail |
public static java.lang.String replaceAll(java.lang.String original, java.lang.String find, java.lang.String replacement)
original
- the string in where the replace will take placefind
- the substring to find and replacereplacement
- the replacement string for all occurences of find
public static java.lang.StringBuffer replaceAll(java.lang.StringBuffer buffer, java.lang.String find, java.lang.String replacement)
buffer
- the StringBuffer in where the replace will take placefind
- the substring to find and replacereplacement
- the replacement string for all occurences of find
public static final java.lang.String arrayToString(java.lang.String[] array, java.lang.String separators)
public static final java.lang.String[] stringToArray(java.lang.String str, java.lang.String separators)
public static java.lang.String removeChars(java.lang.String data, java.lang.String removeChars)
public static java.lang.String stripExtension(java.lang.String filename)
public static java.lang.String replaceVars(java.lang.String origString, java.util.Map vars)
origString
- unmodified stringvars
- Hashtable of replacement values
java.lang.Exception
public static java.util.ArrayList splitString(java.lang.String list, java.lang.String separator)
list
- list of values separated by the separator parameterseparator
- defaults to comma
public static java.util.Map splitStringPairs(java.lang.String list, java.lang.String separator, java.lang.String pairSeparator)
list
- list of values separated by the separator parameterseparator
- defaults to comma
public static java.util.Map splitStringPairs(java.lang.String list, java.lang.String separator, java.lang.String pairSeparator, boolean sortByValue)
list
- separator
- pairSeparator
-
public static java.util.Map sortMapByValue(java.util.Map map)
map
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |