org.mortbay.util
Class Code

java.lang.Object
  |
  +--org.mortbay.util.Code

public class Code
extends java.lang.Object

Coding Standards support. Support for defensive programming Coding defensively as follows:

 {
    ...
    Code.assertTrue(booleanExpression(),"Assert that expression evaluates true");
    ...
    Code.assertEquals(objectA,objectB,"Assert equality");
    Code.assertEquals(1,2,"Assert equality");
    ...
    Code.debug("Debug message");
    ...
    Code.debug("Debug message",exception,object);
    ...
    Code.warning("warning message");
    ...
    Code.warning("warning message",exception);
    ...
    Code.notImplemented();
    Code.fail("fatal error");
    ...
 }
 
The debug output can be controlled with java properties: