|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException com.plumtree.openfoundation.util.XPException
XPException indicates error conditions that an application
might want to catch. Since .Net does not support checked exceptions
and we are looking for matching interface behavior, the Java implementation
of XPException extends RuntimeException.
Preferred usage of XPException is:
try { ... } catch (Exception e) { xpe = XPException.GetInstance(e); ... }
The GetInstance(e) method wraps the platform-specific exception subtype in a
corresponding subtype of XPException.
Constructor Summary | |
XPException()
Constructs an XPException without any user defined message or native Exception to wrap. |
|
XPException(java.lang.String message)
Constructs an XPException with a user defined error message. |
|
XPException(java.lang.String message,
java.lang.Throwable innerException)
This constructor creates an XPException that wraps the native exception with custom message CAUTION: The XPException.GetInstance() method is preferred in most cases, because it maps native exceptions to more specific subtypes of XPException which can be tested for in a cross-platform way. |
|
XPException(java.lang.Throwable innerException)
Constructs an XPException that wraps a native exception. |
Method Summary | |
static java.lang.String |
exceptionToString(java.lang.Throwable exception)
Deprecated. Use XPException.ExceptionToString() by preference in translatable code to match the preferred DotNet uppercase method style. |
static java.lang.String |
ExceptionToString(java.lang.Throwable exception)
Returns string representation of an exception, with type, message, and stack trace. |
java.lang.Throwable |
GetInnerException()
Return a reference to the inner native exception instance wrapped by this exception. |
static XPException |
GetInstance(java.lang.String strErrorMsg,
java.lang.Throwable e)
Wraps a native exception instance as a corresponding subtype of XPException, supplying a context message, and is generally preferred to the XPException constructor for this purpose; XPException instances are augmented with a new "rethrow" stack trace and the new message, but the same instance is returned. |
static XPException |
GetInstance(java.lang.Throwable e)
Creates an instance of a more specific subtype of XPException corresponding to the platform type passed as an argument and wrapping the argument as an inner exception, or returns an XPException unchanged. |
java.lang.String |
getMessage()
Deprecated. Use GetMessage() instead. |
java.lang.String |
GetMessage()
Produces a detailed message string describing the XPException. |
java.lang.String |
GetStackTrace()
Gets a string representation of this exception's stack trace, including rethrow stack traces from XPException.GetInstance() and stack trace from an inner exception if present. |
void |
printStackTrace()
This method prints the stack trace of this exception on the standard error output stream. |
void |
PrintStackTrace()
This method prints the stack trace of this exception on the standard error output stream. |
void |
printStackTrace(java.io.PrintWriter pw)
Deprecated. PrintStackTrace() is preferred for translatable code. |
java.lang.String |
ToString()
Exception message formated as String or the String with which Exception is created. |
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public XPException()
public XPException(java.lang.String message)
message
- User defined error messagepublic XPException(java.lang.Throwable innerException)
innerException
- The native exception to be wrapped.public XPException(java.lang.String message, java.lang.Throwable innerException)
message
- Custom messageinnerException
- The native exception to be wrappedMethod Detail |
public java.lang.String GetMessage()
public java.lang.String getMessage()
public java.lang.Throwable GetInnerException()
public void PrintStackTrace()
for comments on the format used.
public void printStackTrace()
for comments on the format used.
public java.lang.String GetStackTrace()
public void printStackTrace(java.io.PrintWriter pw)
pw
- PrintWriter
to use for outputfor the format used.
public static XPException GetInstance(java.lang.Throwable e)
e
- The native exception to be wrapped, or an XPException to be returned unchanged.
public static XPException GetInstance(java.lang.String strErrorMsg, java.lang.Throwable e)
strErrorMsg
- custom error messagee
- The native exception to be wrapped, or an XPException which will have its message re-set and its stack trace augmented.
public static java.lang.String ExceptionToString(java.lang.Throwable exception)
exception
- Exception to render
for comments on the format used for XPException instances.
public java.lang.String ToString()
public static java.lang.String exceptionToString(java.lang.Throwable exception)
exception
- A Throwable Object.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |