Constructors Summary |
---|
public AbstractRuntimeException()Constructs an exception with null message and null cause.
m_cause = null;
m_arguments = null;
|
public AbstractRuntimeException(String message)Constructs an exception with given error message/code and null cause.
super (message);
m_cause = null;
m_arguments = null;
|
public AbstractRuntimeException(String message, Object[] arguments)Constructs an exception with given error message/code and null cause.
super (message);
m_cause = null;
m_arguments = arguments == null ? null : (Object []) arguments.clone ();
|
public AbstractRuntimeException(Throwable cause)Constructs an exception with null error message/code and given cause.
super ();
m_cause = cause;
m_arguments = null;
|
public AbstractRuntimeException(String message, Throwable cause)Constructs an exception with given error message/code and given cause.
super (message);
m_cause = cause;
m_arguments = null;
|
public AbstractRuntimeException(String message, Object[] arguments, Throwable cause)Constructs an exception with given error message/code and given cause.
super (message);
m_cause = cause;
m_arguments = arguments == null ? null : (Object []) arguments.clone ();
|
Methods Summary |
---|
public void | __printStackTrace(java.io.PrintStream ps)
super.printStackTrace (ps);
|
public void | __printStackTrace(java.io.PrintWriter pw)
super.printStackTrace (pw);
|
public static void | addExceptionResource(java.lang.Class namespace, java.lang.String messageResourceBundleName)Equivalent to {@link ExceptionCommon#addExceptionResource}, repeated here for
convenience. Subclasses should invoke from static initializers only.
'namespace' should be YourException.class.
// note: 'namespace' will be the most derived class; it is possible to
// auto-detect that in a static method but that requires some security
// permissions
ExceptionCommon.addExceptionResource (namespace, messageResourceBundleName);
|
public final java.lang.Throwable | getCause()This implements {@link IThrowableWrapper}
and also overrides the base method in JDK 1.4+.
return m_cause;
|
public final java.lang.String | getErrorCode()Returns the String that was passed as 'message' constructor argument.
Can be null.
return super.getMessage ();
|
public final java.lang.String | getLocalizedMessage()Overrides base method for the sole purpose of making it final.
Equivalent to {@link #getMessage}.
// this is the same as what's done in Throwable
// [copied here to be independent of future JDK changes]
return getMessage ();
|
public final java.lang.String | getMessage()Overrides base method to support error code lookup and avoid returning nulls.
Note that this does not recurse into any 'cause' for message lookup, it only
uses the data passed into the constructor. Subclasses cannot override.
Equivalent to {@link #getLocalizedMessage}.
if (m_message == null) // not synchronized by design
{
String msg;
final String supermsg = super.getMessage ();
final Class _class = getClass ();
if (m_arguments == null)
{
msg = ExceptionCommon.getMessage (_class, supermsg);
}
else
{
msg = ExceptionCommon.getMessage (_class, supermsg, m_arguments);
}
if (msg == null)
{
// this is the same as what's done in Throwable.toString() [copied here to be independent of future JDK changes]
final String className = _class.getName ();
msg = (supermsg != null) ? (className + ": " + supermsg) : className;
}
m_message = msg;
}
return m_message;
|
public final void | printStackTrace(java.io.PrintStream s)Overrides Exception.printStackTrace() to handle nested exceptions in JDKs prior to 1.4.
Subclasses cannot override.
ExceptionCommon.printStackTrace (this, s);
|
public final void | printStackTrace(java.io.PrintWriter s)Overrides Exception.printStackTrace() to handle nested exceptions in JDKs prior to 1.4.
Subclasses cannot override.
ExceptionCommon.printStackTrace (this, s);
|
public final void | printStackTrace()Overrides Exception.printStackTrace() to (a) force the output to go
to System.out and (b) handle nested exceptions in JDKs prior to 1.4.
Subclasses cannot override.
// NOTE: unlike the JDK implementation, force the output to go to System.out:
ExceptionCommon.printStackTrace (this, System.out);
|
private void | writeObject(java.io.ObjectOutputStream out)
getMessage (); // transform this instance to serializable form
out.defaultWriteObject ();
|