01 /*
02 * InvalidURIException.java
03 *
04 * Niraj Aswani, 09/March/07
05 *
06 * $Id: InvalidURIException.html,v 1.0 2007/03/09 16:13:01 niraj Exp $
07 */
08 package gate.creole.ontology;
09
10 import gate.util.GateRuntimeException;
11
12 /**
13 * This exception is thrown when a URI is not valid.
14 *
15 * @author Niraj Aswani
16 *
17 */
18 public class InvalidURIException extends GateRuntimeException {
19 private static final long serialVersionUID = 4121418405812712500L;
20
21 /** Debug flag */
22 private static final boolean DEBUG = false;
23
24 /**
25 * Constructor
26 */
27 public InvalidURIException() {
28 super();
29 }
30
31 /**
32 * Constructor
33 *
34 * @param s Message that should be printed along with the Exception
35 * trace
36 */
37 public InvalidURIException(String s) {
38 super(s);
39 }
40
41 /**
42 * Constructor - behaves like a wrapper to the provided exception
43 *
44 * @param e
45 */
46 public InvalidURIException(Exception e) {
47 this.exception = e;
48 }
49
50 /**
51 * Overriden so we can print the enclosed exception's stacktrace too.
52 */
53 public void printStackTrace() {
54 printStackTrace(System.err);
55 }
56
57 /**
58 * Overriden so we can print the enclosed exception's stacktrace too.
59 */
60 public void printStackTrace(java.io.PrintStream s) {
61 s.flush();
62 super.printStackTrace(s);
63 s.print(" Caused by:\n");
64 if(exception != null) exception.printStackTrace(s);
65 }
66
67 /**
68 * Overriden so we can print the enclosed exception's stacktrace too.
69 */
70 public void printStackTrace(java.io.PrintWriter s) {
71 s.flush();
72 super.printStackTrace(s);
73 s.print(" Caused by:\n");
74 if(exception != null) exception.printStackTrace(s);
75 }
76
77 /**
78 * Internal object of exception, for which the instance behaves like a
79 * wrapper
80 */
81 Exception exception;
82 }
|