688c906cc802d417fec68a7ce91e67cdc699b62d
[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\r
22     extends Error\r
23 {\r
24   public static boolean RegSyntaxErrorEnabled = false;\r
25   public RegSyntaxError()\r
26   {}\r
27 \r
28   public RegSyntaxError(String s)\r
29   {\r
30     super(s);\r
31   }\r
32 \r
33   final static void endItAll(String s)\r
34       throws RegSyntax\r
35   {\r
36     if (RegSyntaxErrorEnabled)\r
37     {\r
38       throw new RegSyntaxError(s);\r
39     }\r
40     throw new RegSyntax(s);\r
41   }\r
42 }\r