|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--sam.ui.ErrorInterface
Abstract error interface
Constructor Summary | |
ErrorInterface()
|
Method Summary | |
void |
fail(java.lang.String message)
Aborts the program. |
void |
fail(java.lang.String message,
java.lang.Throwable error)
Aborts the program due to specified Throwable . |
void |
fail(java.lang.Throwable error)
Aborts the program due to specified Throwable . |
protected abstract void |
failure(java.lang.String message)
|
abstract void |
handleException(java.lang.String message,
java.lang.Throwable e)
Attempts to handle specified exception. |
abstract void |
incompatibleArchiveLayout(int version)
Called whenever an archive of incompatible layout version is submitted for extraction. |
void |
test()
Simple test code. |
abstract void |
unhandledParameter(java.lang.String parameter)
Called in case of an unhandled parameter being parsed from command-line. |
abstract void |
warn(java.lang.String message)
Warns the user about a dangerous, possibly inconsistant or unusal event. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ErrorInterface()
Method Detail |
public abstract void unhandledParameter(java.lang.String parameter)
warn
method
or fail through the fail
method.
Note that it is not possible to handle the parameter (e.g. setting adequate value
into ModusOperandi>/CODE>) since this would be a design mistake.
public abstract void incompatibleArchiveLayout(int version)
warn
method
or fail through the fail
method.
Note that attempts to continue extraction are subjects to subsequent errors as long as the layout
versioning is what it is meant to be.
A conservative workaround is to always use the included runtime of the archive (which is
by construction up-to-date) instead of external binaries.
public abstract void handleException(java.lang.String message, java.lang.Throwable e)
fail
methods.
However the program is expected to pursue its execution as the exception is not believed
to be fatal.
public abstract void warn(java.lang.String message)
protected abstract void failure(java.lang.String message) throws UserInterface.Abort
Abort
- whenever the whole program should abort.
UserInterface.Abort
public final void fail(java.lang.Throwable error) throws UserInterface.Abort
Throwable
.
Note that aborting is implemented through exception throwing rather than abrupt VM interruption
(aka System.exit()
) for obvious reasons.
error
- the Throwable
that caused the fatal error
UserInterface.Abort
public final void fail(java.lang.String message, java.lang.Throwable error) throws UserInterface.Abort
Throwable
.
Note that aborting is implemented through exception throwing rather than abrupt VM interruption
(aka System.exit()
) for obvious reasons.
message
- a human-readable explanation of the error
This might include a workaround suggestionerror
- the Throwable
that caused the fatal error
UserInterface.Abort
public final void fail(java.lang.String message) throws UserInterface.Abort
System.exit()
) for obvious reasons.
message
- a human-readable explanation of the error
This might include a workaround suggestion
UserInterface.Abort
public void test()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |