Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.scopemvc.util
Class Debug  view Debug download Debug.java

java.lang.Object
  extended byorg.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 $

Field Summary
private static org.apache.commons.logging.Log LOG
           
static boolean ON
          Global debug flag to switch debug code on and off.
 
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
 

Field Detail

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
Constructor Detail

Debug

private Debug()
Don't create a Debug -- use static methods.

Method Detail

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)