|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sourceforge.geeboss.util.StringUtil
public class StringUtil
Utility methods for Strings
Method Summary | |
---|---|
static java.lang.String |
createFileName(java.lang.String str)
Create a valid filename from the given String. |
static java.lang.String |
decodeEntitys(java.lang.String text)
Decode all encoded entitys if existing |
static java.lang.String |
decodeISOChar(byte[] isoBytes)
Decode ISO encoded character |
static java.lang.String |
encodeBase64(java.lang.String str)
Return BASE64 encoded value of String |
static java.lang.String |
formatDate(java.util.Date date)
Format a date |
static boolean |
isset(java.lang.String str)
Returns true in case the given String has a value that is not "". |
static boolean |
isTerminating(java.lang.String ch)
Check if a given char is a terminating an URL. |
static boolean |
isWhiteSpaceOrEmpty(java.lang.String str)
Returns true if the String only cosists of whitespaces or is null / empty. |
static java.lang.String |
pointTrim(java.lang.String str,
int length,
boolean escapeMnemonics)
Trims the given String to the given length and appends "..." |
static java.lang.String |
printf(java.lang.String str,
java.lang.String[] wildcard,
java.lang.String[] substitution)
Substitute wildcards in a String and return it |
static java.lang.String |
replaceAll(java.lang.String str,
java.lang.String search,
java.lang.String replace)
This method does exactly the same as String.replaceAll() with the difference that no regular expressions are used to perform the replacement. |
static java.lang.String |
resolveVariables(java.lang.String string,
java.util.Map<java.lang.String,java.lang.Object> variablesMap)
Search a string for variable names of the form ${ |
static java.lang.String |
stripTags(java.lang.String str)
Remove HTML tags from the given String |
static java.lang.String |
unicodeToEntities(java.lang.String str)
Convert the non ASCII-characters of a String into Unicode HTML entities. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.String formatDate(java.util.Date date)
date
- the date to format
public static java.lang.String resolveVariables(java.lang.String string, java.util.Map<java.lang.String,java.lang.Object> variablesMap)
string
- the string to search and replace the variables.variablesMap
- the map containing the variable names associated to a string value.
public static java.lang.String createFileName(java.lang.String str)
str
- The String to convert to a valid filename.
public static java.lang.String decodeEntitys(java.lang.String text)
text
- Current Text
public static java.lang.String decodeISOChar(byte[] isoBytes)
isoBytes
- Bytes representing the char
public static java.lang.String encodeBase64(java.lang.String str)
str
- The String to encode to BASE64
public static boolean isset(java.lang.String str)
str
- The String to check
public static boolean isTerminating(java.lang.String ch)
ch
- Any char
public static boolean isWhiteSpaceOrEmpty(java.lang.String str)
str
- The string to check
public static java.lang.String pointTrim(java.lang.String str, int length, boolean escapeMnemonics)
str
- The String to Trimlength
- The max. length of the StringescapeMnemonics
- If true all "&" will be replaced with "&&"
public static java.lang.String printf(java.lang.String str, java.lang.String[] wildcard, java.lang.String[] substitution)
str
- The String to formatwildcard
- Array of wildcardssubstitution
- Array of wildcards for the substitution of the wildcards.
public static java.lang.String replaceAll(java.lang.String str, java.lang.String search, java.lang.String replace)
str
- The source String to search and replacesearch
- The search term that should get replacedreplace
- The value that replaces the search term
public static java.lang.String stripTags(java.lang.String str)
str
- The String to remove the Tags from
public static java.lang.String unicodeToEntities(java.lang.String str)
str
- The String to convert
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |