1 48 package net.sf.antcontrib.logic; 49 50 import org.apache.tools.ant.BuildException; 51 import org.apache.tools.ant.taskdefs.Exit; 52 import org.apache.tools.ant.types.Reference; 53 54 62 public class Throw extends Exit { 63 64 private Reference ref; 65 66 69 public void setRefid(Reference ref) { 70 this.ref = ref; 71 } 72 73 public void execeute() throws BuildException { 74 Object reffed = ref != null 75 ? ref.getReferencedObject(getProject()) 76 : null; 77 if (reffed != null && reffed instanceof BuildException) { 78 throw (BuildException) reffed; 79 } 80 super.execute(); 81 } 82 } 83 | Popular Tags |