needed for applet search
[jalview.git] / src / com / stevesoft / pat / RegSyntaxError.java
1 //\r
2 // This software is now distributed according to\r
3 // the Lesser Gnu Public License.  Please see\r
4 // http://www.gnu.org/copyleft/lesser.txt for\r
5 // the details.\r
6 //    -- Happy Computing!\r
7 //\r
8 package com.stevesoft.pat;\r
9 \r
10 /** When enabled, this class is thrown instead of\r
11     the normal RegSyntax.  Thus, enabling of this\r
12     class will make your debugging easier -- but\r
13     if you leave it on and forget to catch RegSyntaxError\r
14     a user-supplied pattern could generate a\r
15     RegSyntaxError that will kill your application.\r
16 \r
17     I strongly recommend turning this flag on, however,\r
18     as I think it is more likely to help than to hurt\r
19     your programming efforts.\r
20     */\r
21 public class RegSyntaxError extends Error {\r
22     public static boolean RegSyntaxErrorEnabled = false;\r
23     public RegSyntaxError() {}\r
24     public RegSyntaxError(String s) { super(s); }\r
25     final static void endItAll(String s) throws RegSyntax {\r
26         if(RegSyntaxErrorEnabled) throw new RegSyntaxError(s);\r
27         throw new RegSyntax(s);\r
28     }\r
29 }\r