1 package org.drools.rule; 2 3 public class InstrumentedRule extends Rule 4 { 5 public Boolean isValid; 6 7 public InstrumentedRule(String name) 8 { 9 super( name ); 10 } 11 12 public void isValid(boolean isValid) 13 { 14 if ( isValid ) 15 { 16 this.isValid = Boolean.TRUE; 17 } 18 else 19 { 20 this.isValid = Boolean.FALSE; 21 } 22 } 23 24 public boolean isValid() 25 { 26 if ( this.isValid == null ) 27 { 28 return super.isValid(); 29 } 30 31 return this.isValid.booleanValue(); 32 } 33 34 public void checkValidity() throws InvalidRuleException 35 { 36 if ( this.isValid == null ) 37 { 38 super.checkValidity(); 39 return; 40 } 41 else if ( this.isValid.booleanValue() ) 42 { 43 return; 44 } 45 else 46 { 47 throw new InvalidRuleException( this ); 48 } 49 } 50 }

This page was automatically generated by Maven