|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.oreodata.util.Assert
A helper class that gives us functionality equivalent to C's stdlib assert() macro. Note that assertions should be guarded within code that is conditionally compiled. Try to keep to Eiffel's assertion system. Use static variables defined in a globally used interface class to control the inclusion/exclusion of the blocks of code that contain our assertions. Fie on Joy & Gosling for not having built this into the language.
Constructor Summary | |
Assert()
|
Method Summary | |
static void |
asert(boolean b)
|
static void |
asert(boolean b,
java.lang.String msg)
The most basic assertion test - a boolean test with a message explaining it. |
static void |
canWriteToFile(java.lang.String filename)
convenient method that throws an IOException if the file cannot be written to. |
static void |
hasContent(java.lang.String s)
Special assertion for Strings. |
static void |
rethrow(java.lang.Throwable t)
convenience method to rethrow an exception as a RuntimeException. |
static void |
setFatal(boolean b)
Set fatal to true to cause system exit |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Assert()
Method Detail |
public static void setFatal(boolean b)
public static void asert(boolean b, java.lang.String msg)
public static void asert(boolean b)
public static void hasContent(java.lang.String s)
public static void rethrow(java.lang.Throwable t)
public static void canWriteToFile(java.lang.String filename) throws java.io.IOException
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |