1 20 21 package net.innig.macker.rule; 22 23 import org.jdom.Element; 24 25 import org.apache.regexp.RESyntaxException; 26 27 public class MackerRegexSyntaxException 28 extends RulesException 29 { 30 public MackerRegexSyntaxException(String regexp) 31 { 32 super(getMessage(regexp) + ""); 33 this.regexp = regexp; 34 } 35 36 public MackerRegexSyntaxException(String regexp, RESyntaxException cause) 37 { 38 super(getMessage(regexp) + ": ", cause); 39 this.regexp = regexp; 40 } 41 42 public MackerRegexSyntaxException(String regexp, String message) 43 { 44 super(getMessage(regexp) + ": " + message); 45 this.regexp = regexp; 46 } 47 48 public final String getRegexp() 49 { return regexp; } 50 51 private static String getMessage(String regexp) 52 { return "\"" + regexp + "\" is not a valid Macker regexp pattern"; } 53 54 private final String regexp; 55 } 56 57 58 | Popular Tags |