1 21 package com.izforge.izpack.rules; 22 23 import net.n3.nanoxml.XMLElement; 24 25 import com.izforge.izpack.util.Debug; 26 27 30 public class NotCondition extends Condition 31 { 32 33 protected Condition operand; 34 35 38 public NotCondition() 39 { 40 super(); 41 } 43 44 47 public NotCondition(Condition operand) 48 { 49 this.operand = operand; 50 } 51 52 57 63 64 69 public void readFromXML(XMLElement xmlcondition) 70 { 71 try 72 { 73 if (xmlcondition.getChildrenCount() != 1) 74 { 75 Debug.log("not-condition needs one condition as operand"); 76 return; 77 } 78 this.operand = RulesEngine.analyzeCondition(xmlcondition.getChildAtIndex(0)); 79 } 80 catch (Exception e) 81 { 82 Debug.log("missing element in not-condition"); 83 } 84 } 85 86 92 public boolean isTrue() 93 { 94 return !operand.isTrue(); 95 } 96 } 97 | Popular Tags |