|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
at.spardat.enterprise.exc.BaseException
This class supports the notification of application or system level exceptions. Since this
class works much the same as class Notification, please have a look there
for the description of the API.
What makes this class different from Notification is the fact that you can throw an instance of subclasses of BaseException. Furthermore you may set a detail Throwable at construction time, which should indicate a more detailed (often technical) reason why you are creating and throwing an BaseException.
This class must be sublassed outside the framework.
| Field Summary | |
protected Notification |
notification_
The wrapped notification object |
protected boolean |
showToEndUser_
Indicates if this exception may be shown to the end user or not. |
| Fields inherited from interface at.spardat.enterprise.exc.INotification |
R_ABORT, R_ABORT_RETRY_IGNORE, R_CANCEL, R_IGNORE, R_NO, R_OK, R_OK_CANCEL, R_RETRY, R_RETRY_CANCEL, R_YES, R_YES_NO, R_YES_NO_CANCEL, T_ERROR, T_INFORMATION, T_QUESTION, T_WARNING |
| Constructor Summary | |
protected |
BaseException()
For internal use only. |
|
BaseException(java.lang.Throwable detail,
java.lang.String message,
java.util.Locale l,
java.lang.Object[] params)
Constructs and sets the message from a format string as defined in java.text.MessageFormat. |
| Method Summary | |
boolean |
containsCode(int code)
Returns true if this or any recursively nested detail BaseExceptions code equals code. |
int |
getCode()
Returns the code. |
java.lang.Throwable |
getDetail()
Returns the detail throwable. |
java.lang.String |
getFirstNonEmptyMessage(boolean withClassNamePraefix)
This method takes into account that BaseExceptions might be nested and the outermost exceptions might have empty messages. |
java.lang.String |
getMessage()
Returns a fully descriptive text of this notification. |
java.lang.String |
getMessage(boolean withClassNamePraefix)
Returns the message of this, optionally praefixed by classname and a colon. |
java.lang.String |
getOwnStackTrace()
Returns the result of calling printStackTrace on super. |
int |
getReaction()
Returns the permissible user reaction to the notification which is one of the constants starting with R_. |
java.lang.String |
getShortMessage()
Returns a short text explaining this notification. |
at.spardat.enterprise.exc.StackTrace |
getStackOfThis()
Returns the stack trace of this with a corrected header. |
int |
getType()
Returns the type of this notification, that is one of the constants with praefix T_. |
void |
prepareMigration()
This method should be called if this is about to leave the JVM and therefore must be serialized. |
void |
printStackTrace()
Prints this to System.err. |
void |
printStackTrace(java.io.PrintStream s)
Prints this to the provided PrintStream including the stacktrace and the information of all contained exceptions. |
void |
printStackTrace(java.io.PrintWriter s)
Prints this to the provided PrintWriter including the stacktrace and the information of all contained exceptions. |
BaseException |
setMessage(java.lang.String message)
Constructs and sets the message to the provided value. |
BaseException |
setMessage(java.lang.String messageFmt,
java.lang.Object param1)
Sets the message of this from a one parameter java.text.MessageFormat compatible string. |
BaseException |
setMessage(java.lang.String messageFmt,
java.lang.Object param1,
java.lang.Object param2)
Sets the message of this from a one parameter java.text.MessageFormat compatible string. |
boolean |
showToEndUser()
Indicates if this exception may be directly displayed to the end user. |
java.lang.String |
toString()
Returns a String which contains the class name, message and code of this exception/notification. |
BaseException |
truncateSubclasses()
Creates a AppException or SysException from this that has the property that this and all contained BaseExceptions are instances of AppException or SysException, but not subclasses of them. |
| Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, setStackTrace |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected Notification notification_
protected boolean showToEndUser_
| Constructor Detail |
protected BaseException()
public BaseException(java.lang.Throwable detail,
java.lang.String message,
java.util.Locale l,
java.lang.Object[] params)
detail - detail exception.message - string that either is a java.text.MessageFormat
or not, depending on params.l - a java.util.Locale to format locale
dependent data types or null if the
params do not contain local specifics.params - the parameters of the message. If not null, message
is expected to be a string compliant to MessageFormat.| Method Detail |
public int getCode()
getCode in interface INotificationpublic boolean containsCode(int code)
code - the code to be checked for equality with the code of this or
any contained BaseException.public int getType()
INotification
getType in interface INotificationINotification.getType()public int getReaction()
INotification
getReaction in interface INotificationINotification.getReaction()public java.lang.String getShortMessage()
INotification
getShortMessage in interface INotificationINotification.getShortMessage()public java.lang.String getMessage()
INotification
getMessage in interface INotificationINotification.getMessage()public java.lang.String getFirstNonEmptyMessage(boolean withClassNamePraefix)
withClassNamePraefix - indicates, if the message should be praefixed
by the classname and a colon.
public java.lang.String getMessage(boolean withClassNamePraefix)
withClassNamePraefix - indicates that a classname praefix is required.
public java.lang.Throwable getDetail()
prepareMigration()public boolean showToEndUser()
public void prepareMigration()
getDetail() will return
null afterwards. This method does nothing if there is no detail-throwable. If the detail itself is an BaseException, the method is called recursively.
The end effect of calling this method is, to summarize the words above, that any contained exception, directly or indirectly, is morphed to a String[] if it is not an BaseException.
public java.lang.String toString()
Object.toString()public void printStackTrace()
Throwable.printStackTrace()public void printStackTrace(java.io.PrintStream s)
Throwable.printStackTrace(java.io.PrintStream)public void printStackTrace(java.io.PrintWriter s)
Throwable.printStackTrace(java.io.PrintWriter)public java.lang.String getOwnStackTrace()
public at.spardat.enterprise.exc.StackTrace getStackOfThis()
public BaseException truncateSubclasses()
This (the target object) is destroyed and must not be used anymore!!! This method must not be called from outside the framework!!!
public BaseException setMessage(java.lang.String messageFmt,
java.lang.Object param1,
java.lang.Object param2)
messageFmt - format string as defined in java.text.MessageFormat.param1 - message parameterparam2 - message parameter
public BaseException setMessage(java.lang.String messageFmt,
java.lang.Object param1)
messageFmt - format string as defined in java.text.MessageFormat.param1 - message parameter
public BaseException setMessage(java.lang.String message)
message - text to set
|
IMC Epclient 5.0.3 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||