1 20 21 package net.innig.macker.rule; 22 23 import net.innig.macker.structure.ClassManager; 24 import net.innig.macker.event.MessageEvent; 25 import net.innig.macker.event.MackerIsMadException; 26 import net.innig.macker.event.ListenerException; 27 28 public class Message 29 extends Rule 30 { 31 35 public Message(RuleSet parent, String message) 36 { 37 super(parent); 38 this.message = message; 39 setSeverity(RuleSeverity.INFO); 40 } 41 42 46 public String getMessage() 47 { return message; } 48 49 public void setMessage(String message) 50 { this.message = message; } 51 52 private String message; 53 54 58 public void check(EvaluationContext context, ClassManager classes) 59 throws RulesException, MackerIsMadException, ListenerException 60 { 61 context.broadcastEvent( 62 new MessageEvent( 63 this, 64 VariableParser.parse(context, getMessage()))); 65 } 66 } 67 | Popular Tags |