java.lang.Object
org.scopemvc.util.Debug
- public final class Debug
- extends java.lang.Object
A (very simple) general purpose Debug class for
assertion checking.
e.g.
if (Debug.ON) Debug.assert(thing != null);
if (Debug.ON) Debug.assert(thing != null, "thing is null");
The ON boolean is a
static final so that setting
it to false and rebuilding the project will strip all
debug code from the binaries.
- Version:
- $Revision: 1.4 $ $Date: 2002/01/26 09:46:20 $
|
Constructor Summary |
private |
Debug()
Don't create a Debug -- use static methods. |
|
Method Summary |
static void |
assertTrue(boolean inCondition)
Test preconditions and postconditions like this (but
don't include code in the assertion that changes the state
of anything because it'll be stripped in non-debug
versions):
|
static void |
assertTrue(boolean inCondition,
java.lang.String inMessage)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
private static final org.apache.commons.logging.Log LOG
ON
public static final boolean ON
- Global debug flag to switch debug code on and off.
This must be a
static final for the compiler to
dead-strip all debug statements, which must be prefixed
with: if (Debug.ON)
- See Also:
- Constant Field Values
Debug
private Debug()
- Don't create a Debug -- use static methods.
assertTrue
public static void assertTrue(boolean inCondition)
- Test preconditions and postconditions like this (but
don't include code in the assertion that changes the state
of anything because it'll be stripped in non-debug
versions):
if (Debug.ON) Debug.assert(thing != null);
assertTrue
public static void assertTrue(boolean inCondition,
java.lang.String inMessage)