source: release-kits/wirk3/ant-scripts/tasks/antelope/src/ise/antelope/tasks/AssertException.java@ 15023

Last change on this file since 15023 was 15023, checked in by oranfry, 16 years ago

did the bulk of the work on wirk3

File size: 2.9 KB
Line 
1package ise.antelope.tasks;
2
3import org.apache.tools.ant.Project;
4import org.apache.tools.ant.BuildException;
5import org.apache.tools.ant.Location;
6
7public class AssertException extends BuildException {
8
9 // !@#$%&* Ant has its own EnumeratedAttrbutes to implement the enumeration
10 // pattern, but it's all strings and ints, no real classes...
11 // These numbers MUST match up with the AssertLevel inner class in the
12 // Assert task.
13 public final static int ERROR = 0;
14 public final static int WARN = 1;
15 public final static int DEBUG = 2;
16 public final static int INFO = 3;
17
18 private int assert_level = ERROR;
19
20 public AssertException() {
21 super();
22 }
23 public AssertException(String message) {
24 super(message);
25 }
26 public AssertException(String message, Location location) {
27 super(message, location);
28 }
29 public AssertException(String message, Throwable cause) {
30 super(message, cause);
31 }
32 public AssertException(String message, Throwable cause, Location location) {
33 super(message, cause, location);
34 }
35 public AssertException(Throwable cause) {
36 super(cause);
37 }
38 public AssertException(Throwable cause, Location location) {
39 super(cause, location);
40 }
41 public AssertException(int level) {
42 super();
43 assert_level = level;
44 }
45 public AssertException(String message, int level) {
46 super(message);
47 assert_level = level;
48 }
49 public AssertException(String message, Location location, int level) {
50 super(message, location);
51 assert_level = level;
52 }
53 public AssertException(String message, Throwable cause, int level) {
54 super(message, cause);
55 assert_level = level;
56 }
57 public AssertException(String message, Throwable cause, Location location, int level) {
58 super(message, cause, location);
59 assert_level = level;
60 }
61 public AssertException(Throwable cause, int level) {
62 super(cause);
63 assert_level = level;
64 }
65 public AssertException(Throwable cause, Location location, int level) {
66 super(cause, location);
67 assert_level = level;
68 }
69
70 public void setLevel(int level ) {
71 switch(level) {
72 case ERROR:
73 case WARN:
74 case DEBUG:
75 case INFO:
76 assert_level = level;
77 break;
78 default:
79 throw new IllegalArgumentException("Invalid assert level.");
80 }
81 }
82
83 public int getLevel() {
84 return assert_level;
85 }
86}
Note: See TracBrowser for help on using the repository browser.