1 20 21 package net.innig.macker.rule; 22 23 import net.innig.macker.structure.ClassManager; 24 import net.innig.macker.event.MackerIsMadException; 25 import net.innig.macker.event.ListenerException; 26 27 public abstract class Rule 28 { 29 public Rule(RuleSet parent) 30 { this.parent = parent; } 31 32 public RuleSet getParent() 33 { return parent; } 34 35 public RuleSeverity getSeverity() 36 { 37 if(severity != null) 38 return severity; 39 else if(parent != null) 40 return parent.getSeverity(); 41 else 42 return RuleSeverity.ERROR; 43 } 44 45 public void setSeverity(RuleSeverity severity) 46 { this.severity = severity; } 47 48 public abstract void check( 49 EvaluationContext context, 50 ClassManager classes) 51 throws RulesException, MackerIsMadException, ListenerException; 52 53 private RuleSet parent; 54 private RuleSeverity severity; 55 } | Popular Tags |