|
||||||||||
| 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
org.millscript.commons.alert.Alert
public class Alert
This class represents an alert and is used in combination with a normal exception to indicate a abnormal condition in the system.
| Constructor Summary | |
|---|---|
Alert(java.lang.String comp)
Constructs a new alert with the specified complaint. |
|
Alert(java.lang.String comp,
Alert pa)
Constructs a new alert with the specified complaint and alert cause. |
|
Alert(java.lang.String comp,
java.lang.String exp)
Constructs a new alert with the specified complaint and explanation. |
|
Alert(java.lang.String comp,
java.lang.Throwable pt)
Constructs a new alert with the specified complaint and throwable cause. |
|
| Method Summary | |
|---|---|
Alert |
culprit(java.lang.String type,
boolean value)
Attach a new culprit to this alert, with a boolean as the culprit. |
Alert |
culprit(java.lang.String type,
byte value)
Attach a new culprit to this alert, with a byte as the culprit. |
Alert |
culprit(java.lang.String type,
char value)
Attach a new culprit to this alert, with a char as the culprit. |
Alert |
culprit(java.lang.String type,
double value)
Attach a new culprit to this alert, with a double as the culprit. |
Alert |
culprit(java.lang.String type,
float value)
Attach a new culprit to this alert, with a float as the culprit. |
Alert |
culprit(java.lang.String type,
int value)
Attach a new culprit to this alert, with an int as the culprit. |
Alert |
culprit(java.lang.String type,
long value)
Attach a new culprit to this alert, with a long as the culprit. |
Alert |
culprit(java.lang.String type,
java.lang.Object value)
Attach a new culprit to this alert, with a general object as the culprit. |
Alert |
decorate(AlertDecorator decorator)
Decorates this alert with the information from the supplied decorator. |
Alert |
decorate(java.lang.Object o)
Decorates this alert with information from the supplied object. |
EscapeException |
escape()
Reports this alert as an escape, by throwing it wrapped in an escape exception. |
java.lang.String |
getComplaint()
Returns this alerts complaint. |
java.util.LinkedList<Culprit> |
getCulprits()
Returns this alerts culprits. |
java.lang.String |
getMessage()
|
Alert |
getParentAlert()
Returns the Alert that caused this Alert to be generated. |
java.lang.Throwable |
getParentThrowable()
Returns the Throwable that caused this Alert to be generated. |
Phase |
getPhase()
Returns the phase this Alert occured in. |
java.lang.String |
getReason()
Returns the reason for this Alerts complaint |
boolean |
isMishap()
Returns the mishap indicator flag, true if this
Alert is a mishap and false otherwise. |
Alert |
mishap()
Marks this alert as a mishap and throws itself. |
Alert |
origin(AlertOrigin origin)
Decorates this alert with origin information from the supplied alert origin. |
Alert |
remishap()
Reports this alert as a mishap, by throwing it as an exception. |
void |
report(AlertReporter reporter)
Reports this alert to the specified reporter as a mishap. |
Alert |
setParentAlert(Alert alert)
Sets the parent alert for this alert. |
Alert |
setParentThrowable(java.lang.Throwable throwable)
Sets the parent throwable for this alert. |
Alert |
setPhase(Phase p)
Sets the phase this alert occured in. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Throwable |
|---|
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Alert(java.lang.String comp)
comp - the complaint
public Alert(java.lang.String comp,
java.lang.String exp)
comp - the complaintexp - the complaints explanation
public Alert(java.lang.String comp,
Alert pa)
comp - the complaintpa - the alert that caused this alert to be constructed
public Alert(java.lang.String comp,
java.lang.Throwable pt)
comp - the complaintpt - the throwable that caused this alert to be constructed| Method Detail |
|---|
public Alert culprit(java.lang.String type,
boolean value)
type - the type of culpritvalue - the boolean culprit
public Alert culprit(java.lang.String type,
byte value)
type - the type of culpritvalue - the byte culprit
public Alert culprit(java.lang.String type,
char value)
type - the type of culpritvalue - the char culprit
public Alert culprit(java.lang.String type,
double value)
type - the type of culpritvalue - the double culprit
public Alert culprit(java.lang.String type,
float value)
type - the type of culpritvalue - the float culprit
public Alert culprit(java.lang.String type,
int value)
type - the type of culpritvalue - the int culprit
public Alert culprit(java.lang.String type,
long value)
type - the type of culpritvalue - the long culprit
public Alert culprit(java.lang.String type,
java.lang.Object value)
type - the type of culpritvalue - the object culprit
public Alert decorate(AlertDecorator decorator)
decorator - the decorator to get information from
public Alert decorate(java.lang.Object o)
AlertDecorator, it's
AlertDecorator.decorate(Alert) method will be called otherwise a
generic culprit message will be added to the alert.
The method allows you to hide implementations of AlertDecorator behind interfaces and such, so you can use alerts without have to include the AlertDecorator interface in general API's.
o - the object to decorate this alert with
public EscapeException escape()
public java.lang.String getComplaint()
public java.util.LinkedList<Culprit> getCulprits()
public java.lang.String getMessage()
getMessage in class java.lang.ThrowableThrowable.getMessage()public Alert getParentAlert()
public java.lang.Throwable getParentThrowable()
public Phase getPhase()
public java.lang.String getReason()
public boolean isMishap()
true if this
Alert is a mishap and false otherwise.
true if this Alert is a mishap and
false otherwisepublic Alert mishap()
Alertpublic Alert origin(AlertOrigin origin)
origin - the decorator to get information from
public Alert remishap()
public void report(AlertReporter reporter)
reporter - the AlertReporter to report this mishap Alert topublic Alert setParentAlert(Alert alert)
alert - the parent alert
public Alert setParentThrowable(java.lang.Throwable throwable)
throwable - the throwable that caused this alert
public Alert setPhase(Phase p)
p - the phase for this alertpublic java.lang.String toString()
toString in class java.lang.ThrowableObject.toString()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||