1 20 21 package net.innig.macker.rule.filter; 22 23 import net.innig.macker.rule.*; 24 import net.innig.macker.structure.ClassInfo; 25 import java.util.Map ; 26 import java.util.List ; 27 28 public class InterfaceFilter 29 implements Filter 30 { 31 public Pattern createPattern( 32 RuleSet ruleSet, 33 List params, 34 Map options) 35 throws RulesException 36 { 37 if(params.size() != 0) 38 throw new FilterSyntaxException( 39 this, 40 "Filter \"" + options.get("filter") + "\" expects no parameters, but has " + params.size()); 41 return INTERFACE_PATTERN; 42 } 43 44 private final Pattern INTERFACE_PATTERN = 45 new Pattern() 46 { 47 public boolean matches(EvaluationContext context, ClassInfo classInfo) 48 throws RulesException 49 { return classInfo.isInterface(); } 50 }; 51 } 52 | Popular Tags |