public final class CmsClientStringUtil
extends java.lang.Object
CmsStringUtil
限定符和类型 | 方法和说明 |
---|---|
static java.lang.String |
getMessage(java.lang.Throwable t)
Returns the exception message.
|
static java.lang.String |
getStackTrace(java.lang.Throwable t,
java.lang.String separator)
Returns the stack trace of the Throwable as a string.
|
static java.lang.String |
getStackTraceAsString(java.lang.StackTraceElement[] trace,
java.lang.String separator)
Returns the stack trace as a string.
|
static double |
parseFloat(java.lang.String str)
The parseFloat() function parses a string and returns a float.
|
static int |
parseInt(java.lang.String str)
The parseInt() function parses a string and returns an integer.
|
static void |
pushArray(com.google.gwt.core.client.JavaScriptObject array,
java.lang.String s)
Pushes a String into a javascript array.
|
static java.lang.String |
randomUUID()
Generates a purely random uuid.
|
static java.lang.String |
shortenString(java.lang.String text,
int maxLength)
Shortens the string to the given maximum length.
|
public static java.lang.String getMessage(java.lang.Throwable t)
t
- the exception to get the message forpublic static java.lang.String getStackTrace(java.lang.Throwable t, java.lang.String separator)
t
- the Throwable for which the stack trace should be returnedseparator
- the separator between the lines of the stack tracepublic static java.lang.String getStackTraceAsString(java.lang.StackTraceElement[] trace, java.lang.String separator)
trace
- the stack traceseparator
- the separator between the lines of the stack tracepublic static double parseFloat(java.lang.String str)
Only the first number in the string is returned. Leading and trailing spaces are allowed.
str
- the string to be parsedpublic static int parseInt(java.lang.String str)
Only the first number in the string is returned. Leading and trailing spaces are allowed. If the first character cannot be converted to a number, parseInt() returns zero.
str
- the string to be parsedpublic static void pushArray(com.google.gwt.core.client.JavaScriptObject array, java.lang.String s)
array
- the array to push the String intos
- the String to push into the arraypublic static java.lang.String randomUUID()
public static java.lang.String shortenString(java.lang.String text, int maxLength)
Will include HTML entity ellipses replacing the cut off text.
text
- the string to shortenmaxLength
- the maximum length