1 20 package org.apache.cactus.integration.ant.util; 21 22 import org.apache.tools.ant.Location; 23 import org.apache.tools.ant.Project; 24 import org.apache.tools.ant.Target; 25 import org.apache.tools.ant.Task; 26 27 32 public class DefaultAntTaskFactory implements AntTaskFactory 33 { 34 37 private Project currentProject; 38 39 42 private String currentTaskName; 43 44 47 private Location currentLocation; 48 49 52 private Target currentOwningTarget; 53 54 60 public DefaultAntTaskFactory(Project theProject, 61 String theCurrentTaskName, Location theCurrentLocation, 62 Target theCurrentTarget) 63 { 64 this.currentProject = theProject; 65 this.currentTaskName = theCurrentTaskName; 66 this.currentLocation = theCurrentLocation; 67 this.currentOwningTarget = theCurrentTarget; 68 } 69 70 73 public Task createTask(String theName) 74 { 75 Task retVal = this.currentProject.createTask(theName); 76 if (retVal != null) 77 { 78 retVal.setTaskName(this.currentTaskName); 79 retVal.setLocation(this.currentLocation); 80 retVal.setOwningTarget(this.currentOwningTarget); 81 } 82 return retVal; 83 } 84 } 85 | Popular Tags |