|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.turbine.util.StringUtils
This is where common String manipulation routines should go.
Field Summary | |
static int |
PPKEY_CLASSNAME
|
static int |
PPKEY_ID
|
static int |
PPKEY_PROPERTY
|
Constructor Summary | |
StringUtils()
|
Method Summary | |
static boolean |
equals(java.lang.String s1,
java.lang.String s2)
Compares two Strings, returns true if their values are the same. |
static java.lang.String |
firstLetterCaps(java.lang.String data)
Makes the first letter caps and leaves the rest as is. |
static boolean |
isEmpty(java.lang.String foo)
Determine whether a (trimmed) string is empty |
static boolean |
isValid(java.lang.String foo)
Validates that the supplied string is neither null
nor the empty string. |
static java.lang.String |
join(java.lang.String[] list,
java.lang.String separator)
Joins the elements of the provided array into a single string containing a list of CSV elements. |
static java.lang.String |
makeString(java.lang.String foo)
Deal with null strings converting them to "" instead. |
static java.lang.String[] |
parseObjectKey(java.lang.String s)
Takes a String of the form substring[substring]subtring and returns the 3 substrings |
static java.lang.String |
removeUnderScores(java.lang.String data)
Remove Underscores from a string and replaces first Letters with Capitals. |
static java.lang.String[] |
split(java.lang.String text,
java.lang.String separator)
Splits the provided CSV text into a list. |
static java.lang.String |
stackTrace(java.lang.Throwable e)
Returns the output of printStackTrace as a String. |
static java.lang.String |
stackTrace(java.lang.Throwable e,
boolean addPre)
Returns the output of printStackTrace as a String. |
protected static java.lang.String |
wrapLine(java.lang.String line,
java.lang.String newline,
int wrapColumn)
Wraps a single line of text. |
static java.lang.String |
wrapText(java.lang.String inString,
java.lang.String newline,
int wrapColumn)
Takes a block of text which might have long lines in it and wraps the long lines based on the supplied wrapColumn parameter. |
Methods inherited from class java.lang.Object |
|
Field Detail |
public static final int PPKEY_CLASSNAME
public static final int PPKEY_ID
public static final int PPKEY_PROPERTY
Constructor Detail |
public StringUtils()
Method Detail |
public static final java.lang.String makeString(java.lang.String foo)
foo
- A String.public static final boolean isValid(java.lang.String foo)
null
nor the empty string.foo
- The text to check.public static final boolean isEmpty(java.lang.String foo)
foo
- The text to check.public static final java.lang.String stackTrace(java.lang.Throwable e)
e
- A Throwable.public static final java.lang.String stackTrace(java.lang.Throwable e, boolean addPre)
e
- A Throwable.addPre
- a boolean to add HTML tags around the stacktrace
public static boolean equals(java.lang.String s1, java.lang.String s2)
s1
- The first string.s2
- The second string.public static java.lang.String[] parseObjectKey(java.lang.String s)
public static java.lang.String removeUnderScores(java.lang.String data)
public static java.lang.String firstLetterCaps(java.lang.String data)
public static java.lang.String[] split(java.lang.String text, java.lang.String separator)
text
- The CSV list of values to split apart.separator
- The separator character.public static java.lang.String join(java.lang.String[] list, java.lang.String separator)
list
- The list of values to join together.separator
- The separator character.public static java.lang.String wrapText(java.lang.String inString, java.lang.String newline, int wrapColumn)
inString
- Text which is in need of word-wrapping.newline
- The characters that define a newline.wrapColumn
- The column to wrap the words at.protected static java.lang.String wrapLine(java.lang.String line, java.lang.String newline, int wrapColumn)
line
- A line which is in need of word-wrapping.newline
- The characters that define a newline.wrapColumn
- The column to wrap the words at.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |