|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Object java.lang.Enum<CanonicalExitCode> org.hyphenType.exit.CanonicalExitCode
public enum CanonicalExitCode
The simplest status code one could possibly conceive. Status codes in this
enumeration will not do anything before JVM termination (in other words,
StatusCode#beforeExit()
is empty). This enumeration does not specify
anything more meaningful than success versus failure. If you want your
program to generate more specific codes, create your own enumeration that
implements the StatusCode
interface.
Enum Constant Summary | |
---|---|
ERROR
Status code to report any problem during the execution of a program. |
|
SUCCESS
Status code to report a successful execution of a program. |
Method Summary | |
---|---|
void |
beforeExit(ExitStatusHelper helper)
A call back method that is invoked by the method Options#exit(Enum) right before attempting to terminate the VM. |
static CanonicalExitCode |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static CanonicalExitCode[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final CanonicalExitCode SUCCESS
public static final CanonicalExitCode ERROR
Method Detail |
---|
public static CanonicalExitCode[] values()
for (CanonicalExitCode c : CanonicalExitCode.values()) System.out.println(c);
public static CanonicalExitCode valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic void beforeExit(ExitStatusHelper helper)
StatusCode
Options#exit(Enum)
right before attempting to terminate the VM.
This method can be used to output custom message to the console, for
instance.Runtime.addShutdownHook(Thread)
. The
main difference is that this method will be called on the enumeration
constant related to the exit status.
beforeExit
in interface StatusCode
helper
- A helper object that gives access to some utility methods.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |