* @see org.apache.tools.ant.Task#execute()
*/
public void execute() throws BuildException {
BeanFactory parentBeanFactory = getBeanFactory();
Project project = getProject();
if ((taskref == null) || !project.getReferences().containsKey(taskref)) {
throw new BuildException(
"The project does not contain the required reference: ["
+ taskref + "]");
}
// Check that the reference we were given is a valid Task instance
Object ref = project.getReference(taskref);
if (!(ref instanceof Task)) {
throw new BuildException("Reference (" + taskref
+ ") does not refer to a task");
}
Task target = (Task) ref;