KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > versant > core > common > Debug


1 package com.versant.core.common;
2
3 import java.io.PrintStream JavaDoc;
4
5 /**
6  * Master debugging output flags. This class must be final so that the
7  * debugging code is stripped by javac/jikes at compile time if the flag is
8  * false. This is copied to a java file with token replacement and compiled
9  * by the Ant build.
10  */

11 public final class Debug {
12
13     public Debug() {}
14
15     public static final String JavaDoc BUILD_DATE = "1118527200000";
16     public static final String JavaDoc VERSION = "4.0.0beta4";
17
18     public static final PrintStream JavaDoc OUT = System.out;
19     public static final PrintStream JavaDoc ERR = System.err;
20
21     public static final boolean DEBUG = false;
22
23     public static final void assertRuntime(boolean _assert, String JavaDoc message) {
24         if (!_assert) {
25             throw BindingSupportImpl.getInstance().runtime(message);
26         }
27     }
28
29     public static final void assertFatal(boolean _assert, String JavaDoc message) {
30         if (!_assert) {
31             throw BindingSupportImpl.getInstance().fatal(message);
32         }
33     }
34
35     public static final void assertInternal(boolean _assert, String JavaDoc message) {
36         if (!_assert) {
37             throw BindingSupportImpl.getInstance().internal(message);
38         }
39     }
40
41     public static final void assertSecurity(boolean _assert, String JavaDoc message) {
42         if (!_assert) {
43             throw BindingSupportImpl.getInstance().security(message);
44         }
45     }
46
47     public static final void assertIllegalArgument(boolean _assert,
48                                                    String JavaDoc message) {
49         if (!_assert) {
50             throw BindingSupportImpl.getInstance().illegalArgument(message);
51         }
52     }
53
54     public static final void assertIndexOutOfBounds(boolean _assert,
55                                                     String JavaDoc message) {
56         if (!_assert) {
57             throw BindingSupportImpl.getInstance().indexOutOfBounds(message);
58         }
59     }
60
61     public static final void assertInvalidOperation(boolean _assert,
62                                                     String JavaDoc message) {
63         if (!_assert) {
64             throw BindingSupportImpl.getInstance().invalidOperation(message);
65         }
66     }
67 }
68
Popular Tags