org.jwarp.util
Class StringUtil

java.lang.Object
  |
  +--org.jwarp.util.StringUtil

public final class StringUtil
extends java.lang.Object

This class provides basic facilities for manipulating strings.

Author:
Anatole Tresch

Method Summary
protected static java.lang.String[] captureStackTrace(java.lang.Throwable throwable)
          Captures the stack trace associated with this exception.
static java.lang.String printStackTrace(java.lang.Throwable throwable)
          Prints out the stack trace of a throwable to a string.
static java.lang.String printStackTrace(java.lang.Throwable throwable, boolean printCascading)
          Prints out the stack trace of a throwable to a string.
static java.lang.String printStackTrace(java.lang.Throwable throwable, int depth)
          Prints out the stack trace of a throwable to a string.
static java.lang.String printStackTrace(java.lang.Throwable throwable, int depth, boolean printCascading)
          Prints out the stack trace of a throwable to a string.
static java.lang.String replaceSubString(java.lang.String original, java.lang.String oldString, java.lang.String newString)
          Replace substrings of one string with another string and return altered string.
protected static java.lang.String[] splitStackTrace(java.lang.String stackTrace)
          Splits the stack trace given as a newline separated string into an array of stack frames.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

replaceSubString

public static java.lang.String replaceSubString(java.lang.String original,
                                                java.lang.String oldString,
                                                java.lang.String newString)
Replace substrings of one string with another string and return altered string.
Parameters:
original - input string
oldString - the substring section to replace
newString - the new substring replacing old substring section
Returns:
converted string

printStackTrace

public static java.lang.String printStackTrace(java.lang.Throwable throwable)
Prints out the stack trace of a throwable to a string.
Parameters:
throwable - The input
Returns:
A string containing the stack trace

printStackTrace

public static java.lang.String printStackTrace(java.lang.Throwable throwable,
                                               boolean printCascading)
Prints out the stack trace of a throwable to a string.
Parameters:
throwable - The input
print - also the cascading exceptions
Returns:
A string containing the stack trace

printStackTrace

public static java.lang.String printStackTrace(java.lang.Throwable throwable,
                                               int depth)
Prints out the stack trace of a throwable to a string.
Parameters:
throwable - The input
How - many stack events shoud be printed
Returns:
A string containing the stack trace

printStackTrace

public static java.lang.String printStackTrace(java.lang.Throwable throwable,
                                               int depth,
                                               boolean printCascading)
Prints out the stack trace of a throwable to a string.
Parameters:
throwable - The input
How - many stack events shoud be printed
print - also the cascading exceptions
Returns:
A string containing the stack trace

captureStackTrace

protected static java.lang.String[] captureStackTrace(java.lang.Throwable throwable)
Captures the stack trace associated with this exception.
Returns:
an array of Strings describing stack frames.

splitStackTrace

protected static java.lang.String[] splitStackTrace(java.lang.String stackTrace)
Splits the stack trace given as a newline separated string into an array of stack frames.
Parameters:
stackTrace - the stack trace.
Returns:
an array of Strings describing stack frames.

©   O R C A   S y s t e m s