|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.extensions.webscripts.ui.common.StringUtils
public class StringUtils
Class containing misc helper methods for managing Strings. NOTE: Extracted from org.alfresco.web.ui.common.Utils;
Constructor Summary | |
---|---|
StringUtils()
|
Method Summary | |
---|---|
static String |
cropEncode(String text)
Crop a label within a SPAN element, using ellipses '...' at the end of label and and encode the result for HTML output. |
static String |
cropEncode(String text,
int length)
Crop a label within a SPAN element, using ellipses '...' at the end of label and and encode the result for HTML output. |
static String |
encode(String string)
Encodes the given string, so that it can be used within an HTML page. |
static String |
encodeJavascript(String s)
Encode a string to the %AB hex style JavaScript compatible notation. |
static String |
remove(String str,
String match)
Remove all occurances of a String from a String |
static String |
replace(String str,
String repl,
String with)
Replace one string instance with another within the specified string |
static String |
replaceLineBreaks(String str,
boolean xhtml)
Replaces carriage returns and line breaks with the <br> tag. |
static String |
stripUnsafeHTMLTags(String s)
Strip unsafe HTML tags from a string - only leaves most basic formatting tags and encodes the remaining characters. |
static String |
stripUnsafeHTMLTags(String s,
boolean encode)
Strip unsafe HTML tags from a string - only leaves most basic formatting tags and optionally encodes or strips the remaining characters. |
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 String encode(String string)
string
- the String to convertpublic static String cropEncode(String text)
text
- to crop and encode
public static String cropEncode(String text, int length)
text
- to crop and encodelength
- length of string to crop too
public static String encodeJavascript(String s)
s
- string to encode
public static String stripUnsafeHTMLTags(String s)
s
- HTML string to strip tags from
public static String stripUnsafeHTMLTags(String s, boolean encode)
s
- HTML string to strip tags fromencode
- if true then encode remaining html data
public static String replace(String str, String repl, String with)
str
- repl
- with
-
public static String remove(String str, String match)
str
- String to remove occurances frommatch
- The string to remove
public static String replaceLineBreaks(String str, boolean xhtml)
str
- The string to be parsed
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |