01: package com.versant.core.common;
02:
03: import java.io.PrintStream;
04:
05: /**
06: * Master debugging output flags. This class must be final so that the
07: * debugging code is stripped by javac/jikes at compile time if the flag is
08: * false. This is copied to a java file with token replacement and compiled
09: * by the Ant build.
10: */
11: public final class Debug {
12:
13: public Debug() {
14: }
15:
16: public static final String BUILD_DATE = "1118527200000";
17: public static final String VERSION = "4.0.0beta4";
18:
19: public static final PrintStream OUT = System.out;
20: public static final PrintStream ERR = System.err;
21:
22: public static final boolean DEBUG = false;
23:
24: public static final void assertRuntime(boolean _assert,
25: String message) {
26: if (!_assert) {
27: throw BindingSupportImpl.getInstance().runtime(message);
28: }
29: }
30:
31: public static final void assertFatal(boolean _assert, String message) {
32: if (!_assert) {
33: throw BindingSupportImpl.getInstance().fatal(message);
34: }
35: }
36:
37: public static final void assertInternal(boolean _assert,
38: String message) {
39: if (!_assert) {
40: throw BindingSupportImpl.getInstance().internal(message);
41: }
42: }
43:
44: public static final void assertSecurity(boolean _assert,
45: String message) {
46: if (!_assert) {
47: throw BindingSupportImpl.getInstance().security(message);
48: }
49: }
50:
51: public static final void assertIllegalArgument(boolean _assert,
52: String message) {
53: if (!_assert) {
54: throw BindingSupportImpl.getInstance().illegalArgument(
55: message);
56: }
57: }
58:
59: public static final void assertIndexOutOfBounds(boolean _assert,
60: String message) {
61: if (!_assert) {
62: throw BindingSupportImpl.getInstance().indexOutOfBounds(
63: message);
64: }
65: }
66:
67: public static final void assertInvalidOperation(boolean _assert,
68: String message) {
69: if (!_assert) {
70: throw BindingSupportImpl.getInstance().invalidOperation(
71: message);
72: }
73: }
74: }
|