|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Handler
ATHandler represents a first-class exception handler which have a filter object, describing the kind of exceptions caught by the handler and a code block which acts as replacement code for the code that raised the exception.
Method Summary | |
---|---|
Boolean |
canHandle(Object exception)
Returns whether a handler will be triggered when an exception is raised. |
Object |
handle(Object exception)
Evaluates the associated handler closure if the handler can handle the given exception. |
Methods inherited from interface edu.vub.at.objects.Object |
---|
super |
Method Detail |
---|
Boolean canHandle(Object exception)
The primary use of this method is to provide a hook to deviate from the default semantics, which is:
def canHandle(anException) {
(reflect: anException).isCloneOf(filter);
};
exception
- an exception.
Object handle(Object exception)
When a handler has answered that it can handle an exception, the following method is invoked, asking the handler to handle the exception. The default semantics is simply to invoke the associated handler closure.
def handle(anException) {
handler(anException)
};
exception
- an exception to be handled.
Object
representing the result of evaluating the associated handler closure.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |