1 18 19 package org.apache.tools.ant.taskdefs.condition; 20 21 import org.apache.tools.ant.BuildException; 22 23 31 public class Not extends ConditionBase implements Condition { 32 33 39 public boolean eval() throws BuildException { 40 if (countConditions() > 1) { 41 throw new BuildException("You must not nest more than one " 42 + "condition into <not>"); 43 } 44 if (countConditions() < 1) { 45 throw new BuildException("You must nest a condition into <not>"); 46 } 47 return !((Condition) getConditions().nextElement()).eval(); 48 } 49 50 } 51 | Popular Tags |