|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.empire.commons.ErrorObject
public abstract class ErrorObject
This class holds and provides information about the last error that occured on an object.
In order to use this class you must derive your class from Error Object.
If a method fails then you must set the error by calling one of the error(...) functions.
The method usually indicates failure by returning false.
You may then retrieve error information by calling one of the function defined by the ErrorInfo
interface.
All classes of the empire framework are derived from this class.
This class is thread save so each thread may have it's own error information for a particular object.
Constructor Summary | |
---|---|
ErrorObject()
Constructs an ErrorObject object. |
|
ErrorObject(ErrorInfo other)
Constructs a ErrorObject object copying the Error information of another object. |
Method Summary | |
---|---|
void |
clearError()
Clears the error for this object. |
java.lang.String |
getErrorMessage()
Returns the message associated with the last error. |
java.lang.Object[] |
getErrorParams()
Returns the parameters used to build the error text. |
java.lang.String |
getErrorSource()
Returns the parameters used to build the error text. |
ErrorType |
getErrorType()
Returns the last error code. |
static java.lang.String |
getMessage(ErrorInfo error)
Returns the message associated with an error. |
boolean |
hasError()
Returns wether or not an error is set. |
static boolean |
isExceptionsEnabled()
Returns wether or not Exceptions will be thrown on failure. |
static void |
setExceptionsEnabled(boolean enableExceptions)
Use this to enable or disable Exceptions. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ErrorObject()
public ErrorObject(ErrorInfo other)
other
- the source error informationMethod Detail |
---|
public static boolean isExceptionsEnabled()
public static void setExceptionsEnabled(boolean enableExceptions)
enableExceptions
- true to enable exceptions or false to disablepublic static java.lang.String getMessage(ErrorInfo error)
error
- the error information for which to obtain an error message
public final boolean hasError()
hasError
in interface ErrorInfo
public final ErrorType getErrorType()
getErrorType
in interface ErrorInfo
public final java.lang.String getErrorSource()
getErrorSource
in interface ErrorInfo
public final java.lang.Object[] getErrorParams()
getErrorParams
in interface ErrorInfo
public final void clearError()
public final java.lang.String getErrorMessage()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |