|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.smartgwt.client.util.StringUtil
public class StringUtil
Constructor Summary | |
---|---|
StringUtil()
|
Method Summary | |
---|---|
static String |
abbreviate(String str,
int maxWidth)
Abbreviates a String using ellipses. |
static String |
asHTML(String str)
Convert plain text into into displayable HTML. |
static String |
asHTML(String str,
boolean noAutoWrap)
Convert plain text into into displayable HTML. |
static String |
convertTags(String str,
String prefix,
String suffix)
Convert all tag symbols ( < and > ) into displayable HTML by changing them to < and > respectively. |
static String |
makeXMLSafe(String str)
Escapes special characters in XML values - so called 'unparsed data' |
static String |
unescapeHTML(String str)
Reverses asHTML(String) . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public StringUtil()
Method Detail |
---|
public static String convertTags(String str, String prefix, String suffix)
str
- the string to convertprefix
- text to tack onto the beginning of result (eg: "<PRE>")suffix
- text to tack onto the end of result (eg: "</PRE>")
public static String asHTML(String str)
converts to -------- --------------------------- & & < < > > \r,\n,\r\n1space
\r,\n,\r\n
\t 2 spaces 1space
str
- the string to convert
public static String asHTML(String str, boolean noAutoWrap)
converts to -------- --------------------------- & & < < > > \r,\n,\r\n1space
\r,\n,\r\n
\t 2 spaces 1space
str
- the string to convertnoAutoWrap
-
public static String unescapeHTML(String str)
asHTML(String)
.
str
- the input str
public static String makeXMLSafe(String str)
" -> " ' -> ' & -> & < -> < > -> > \r -> &x000D;
str
- the String to escape
public static String abbreviate(String str, int maxWidth)
str
- the String to abbreviatemaxWidth
- maximum length of result String, must be at least 4
IllegalArgumentException
- when the width is too small
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |