|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.enterprise.util.StringUtils
public class StringUtils
| Field Summary | |
|---|---|
static String |
EOL
|
static String |
NEWLINE
|
| Method Summary | |
|---|---|
static String |
cat(String separator,
String... list)
Concatenate a list of strings, putting a separator in between each one. |
static String |
formatSQLException(SQLException ex)
|
static String |
getPenultimateDirName(String s)
|
static String |
getProperty(String propName)
Get a system propety given a property name, possibly trying all combination of upercase, name mangling to get a value. |
static String |
getStackTrace(Throwable t)
|
static boolean |
isHex(char c)
|
static boolean |
isHex(String s)
|
static boolean |
isToken(String s)
|
static void |
main(String[] args)
|
static String |
makeFilePath(String[] strings,
boolean addTrailing)
A utility to get the Operating System specific path from given array of Strings. |
static int |
maxWidth(Vector v)
|
static boolean |
ok(String s)
|
static String |
padLeft(String s,
int len)
|
static String |
padRight(String s,
int len)
|
static List<String> |
parseStringList(String line)
Parses a string containing substrings separated from each other by the standard separator characters and returns a list of strings. |
static List<String> |
parseStringList(String line,
String sep)
Parses a string containing substrings separated from each other by the specified set of separator characters and returns a list of strings. |
static void |
prepend(String[] ss,
String what)
|
static String |
quotePathIfNecessary(String path)
Nightmares can result from using a path with a space in it! This method will enclose in quotes if needed. |
static String |
removeChar(String strOrig,
char c)
Remove a character from a String |
static String |
removeEnclosingQuotes(String s)
Removes the quoting around a String. |
static String |
replace(String s,
String token,
String replace)
|
static int |
safeLength(String s)
return the length of the String - or 0 if it's null |
static String |
stripToken(String s)
|
static void |
testUpperCase()
|
static String[] |
toLines(String s)
|
static String |
toShortClassName(String className)
|
static String |
toString(Properties props)
|
static String |
UpperCaseFirstLetter(String s)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String NEWLINE
public static final String EOL
| Method Detail |
|---|
public static int safeLength(String s)
public static boolean ok(String s)
public static String formatSQLException(SQLException ex)
public static int maxWidth(Vector v)
public static boolean isHex(String s)
public static boolean isHex(char c)
public static String getPenultimateDirName(String s)
public static String toShortClassName(String className)
public static String padRight(String s,
int len)
public static String padLeft(String s,
int len)
public static String[] toLines(String s)
public static void prepend(String[] ss,
String what)
public static String UpperCaseFirstLetter(String s)
public static String replace(String s,
String token,
String replace)
public static String toString(Properties props)
public static void main(String[] args)
public static void testUpperCase()
public static String makeFilePath(String[] strings,
boolean addTrailing)
strings - an array of Strings participating in the path.addTrailing - a boolean that determines whether the returned
String should have a trailing File Separator character. None of
the strings may be null or empty String. An exception is thrown.
IllegalArgumentException - if any of the arguments is null or is
an empty string.public static List<String> parseStringList(String line)
line into individual string elements
separated by the field separators, and returns these individual
strings as a list of strings. The individual string elements are
trimmed of leading and trailing whitespace. Only non-empty strings
are returned in the list.
line - The string to split
public static List<String> parseStringList(String line,
String sep)
line into individual string elements
separated by the field separators specified in sep,
and returns these individual strings as a list of strings. The
individual string elements are trimmed of leading and trailing
whitespace. Only non-empty strings are returned in the list.
line - The string to splitsep - The list of separators to use for determining where the
string should be split. If null, then the standard
separators (see StringTokenizer javadocs) are used.
public static String getProperty(String propName)
propName - the approximate system property name
public static String removeChar(String strOrig,
char c)
strOrig - original stringc - character to remove from the string
public static String getStackTrace(Throwable t)
public static final boolean isToken(String s)
public static final String stripToken(String s)
public static String cat(String separator,
String... list)
separator - Separator to use between concatenated stringslist - List of strings to concatenate together
public static String removeEnclosingQuotes(String s)
s - The String that may have enclosing quotes
public static String quotePathIfNecessary(String path)
path -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||