|
||||||||||
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
se.biltmore.tools.odttoapt.maven.plugin.Failure
public class Failure
This is a special class handling failures, and handling them differently depending on configuration.
Nested Class Summary | |
---|---|
private static class |
Failure.ThreadInstance
Provides a thread safe instance of the failure handler. |
Field Summary | |
---|---|
private boolean |
dontFail
When true we only display warnings, otherwise and exceptions is thrown. |
private PrintStream |
failStream
The stream to write failure messages to. |
private static Failure.ThreadInstance |
failureHandlerWrapper
The handler instance of this class hung on the local thread. |
Constructor Summary | |
---|---|
private |
Failure()
Creates a new Failure instance. |
private |
Failure(String message)
Creates a new Failure instance. |
private |
Failure(String message,
Exception cause)
Creates a new Failure instance. |
Method Summary | |
---|---|
private void |
_fail(String message)
Handles a failure. |
private void |
_fail(String message,
Exception cause)
Handles a failure. |
private void |
_warn(String message)
Displays a warning message. |
static void |
fail(String message)
Hanldes a failure. |
static void |
fail(String message,
Exception cause)
Handles a failure. |
static void |
initialize(boolean dontFail,
OutputStream failStream)
Initialized the failure handler. |
private void |
setDontFail(boolean dontFail)
Sets the dont fail parameter. |
private void |
setFailStream(PrintStream failStream)
Sets the stream to write failure messages on. |
static void |
warn(String message)
Displays a warning message. |
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private boolean dontFail
private PrintStream failStream
private static Failure.ThreadInstance failureHandlerWrapper
Constructor Detail |
---|
private Failure()
private Failure(String message)
messgae
- The failure message.private Failure(String message, Exception cause)
message
- The failure messagecause
- The cause of the failure.Method Detail |
---|
private void setDontFail(boolean dontFail)
dontFail
- The value to set.private void setFailStream(PrintStream failStream)
failStream
- The stream to set.private void _fail(String message) throws Failure
message
- The failure message.
Failure
- unless dontFail is true.private void _fail(String message, Exception cause) throws Failure
message
- The failure message.cause
- The cause of the failure.
Failure
- unless dontFail is true.private void _warn(String message)
message
- The warning message to display.public static void initialize(boolean dontFail, OutputStream failStream)
dontFail
- true will only display a message without breaking the build.failStream
- The stream to write failure messages on.public static void fail(String message)
message
- The failure message.public static void fail(String message, Exception cause)
message
- The failure message.cause
- The cause of the failure.public static void warn(String message)
message
- The warning message to display.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |