|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |
@Retention(value=RUNTIME) @Target(value=FIELD) public @interface ExitStatusConstant
A message to decorate the exit status constants for the final users.
Required Element Summary | |
---|---|
String |
message
Message to the end user of the application when a problem happens. |
String |
userDescription
The description that will appear in the documentation for the end user. |
Optional Element Summary | |
---|---|
Class<? extends Throwable>[] |
catches
The list of throwable classes that will be caught by the exit status constant decorated by this annotation. |
Element Detail |
---|
public abstract String userDescription
public abstract String message
Formatter.format(String, Object...)
. The values of replacement
objects ({0}, {1}, etc.) depends on how the JVM or environment is going
to exit:Options.exit(Enum, Object...)
- The values
of {0}, {1}, etc will be set to be the values of the array (second
argument).Options#exit(int, Object...))
- Idem to the
above.Options.exit(Throwable)
- {0} will be set to
be Throwable.getLocalizedMessage()
and {1} will be the string
printed by calling Throwable.printStackTrace()
.catches()
. When an exception is caught by an
exit status constant, {0} and {1} will be treated as in the above: {0}
will be set to be Throwable.getLocalizedMessage()
and {1} will be
the string printed by calling Throwable.printStackTrace()
Throwable.getLocalizedMessage()
is
null, it will be replaced by the empty string. This is to avoid the end
user receiving a message such as: "Program terminated. Error message:
null".
public abstract Class<? extends Throwable>[] catches
StatusCode.beforeExit(ExitStatusHelper)
is called on this exit
status constant and the throwable is accessible to the exit status
constant via the method ExitStatusHelper.getThrowable()
.NonExceptionalExit
cannot
be trapped by any exit status constant, since the
NonExceptionalExit
exception has a special meaning in
hyphenType. For more details about the NonExceptionalExit
exception, refer to the documentation of this class.
NonExceptionalExit
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: REQUIRED | OPTIONAL | DETAIL: ELEMENT |