1 20 21 package net.innig.macker.rule; 22 23 import net.innig.macker.structure.ClassInfo; 24 25 import java.util.*; 26 27 import org.apache.regexp.RE; 28 import org.apache.regexp.RESyntaxException; 29 30 public final class RegexPattern 31 implements Pattern 32 { 33 37 public RegexPattern(String regexStr) 38 throws MackerRegexSyntaxException 39 { regex = new MackerRegex(regexStr); } 40 41 45 public MackerRegex getRegex() 46 { return regex; } 47 48 private final MackerRegex regex; 49 50 54 public boolean matches(EvaluationContext context, ClassInfo classInfo) 55 throws RulesException 56 { return regex.matches(context, classInfo.getFullName()); } 57 58 public String getMatch(EvaluationContext context, ClassInfo classInfo) 59 throws RulesException 60 { return regex.getMatch(context, classInfo.getFullName()); } 61 62 public String toString() 63 { return regex.toString(); } 64 } 65 66 | Popular Tags |