1 18 19 package org.apache.tools.ant.taskdefs.condition; 20 21 import org.apache.tools.ant.BuildException; 22 import org.apache.tools.ant.ProjectComponent; 23 24 29 public class IsTrue extends ProjectComponent implements Condition { 30 33 private Boolean value = null; 34 35 39 public void setValue(boolean value) { 40 this.value = value ? Boolean.TRUE : Boolean.FALSE; 41 } 42 43 47 public boolean eval() throws BuildException { 48 if (value == null) { 49 throw new BuildException("Nothing to test for truth"); 50 } 51 return value.booleanValue(); 52 } 53 54 } 55 56 | Popular Tags |