/** * Creates a named task and configures it up to the init() stage. * * @param ue The UnknownElement to create the real task for. * Must not be <code>null</code>. * @param w Ignored. * * @return the task specified by the given unknown element, or * <code>null</code> if the task name is not recognised. */ protected Task makeTask(UnknownElement ue, RuntimeConfigurable w) { Task task = getProject().createTask(ue.getTag()); if (task != null) { task.setLocation(getLocation()); // UnknownElement always has an associated target task.setOwningTarget(getOwningTarget()); task.init(); } return task; }
/** * Factory method to create the components. * * This should be called by UnknownElement. * * @param ue The Unknown Element creating this component. * @param ns Namespace URI. Also available as ue.getNamespace(). * @param componentType The component type, * Also available as ue.getComponentName(). * @return the created component. * @throws BuildException if an error occurs. */ public Object createComponent(UnknownElement ue, String ns, String componentType) throws BuildException { Object component = createComponent(componentType); if (component instanceof Task) { Task task = (Task) component; task.setLocation(ue.getLocation()); task.setTaskType(componentType); task.setTaskName(ue.getTaskName()); task.setOwningTarget(ue.getOwningTarget()); task.init(); } return component; }
/** * Bind a task to another; use this when configuring a newly created * task to do work on behalf of another. * Project, OwningTarget, TaskName, Location and Description are all copied * * Important: this method does not call {@link Task#init()}. * If you are creating a task to delegate work to, call {@link Task#init()} * to initialize it. * * @param owner owning target * @since Ant1.7 */ public final void bindToOwner(Task owner) { setProject(owner.getProject()); setOwningTarget(owner.getOwningTarget()); setTaskName(owner.getTaskName()); setDescription(owner.getDescription()); setLocation(owner.getLocation()); setTaskType(owner.getTaskType()); } }
task.setLocation(new Location(helperImpl.locator)); helperImpl.configureId(task, attrs);
/** * {@inheritDoc} * @see AntTaskFactory#createTask(String) */ public Task createTask(String theName) { Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; } }
/** * {@inheritDoc} * @see AntTaskFactory#createTask(String) */ public Task createTask(String theName) { Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; } }
/** * {@inheritDoc} */ @Override public Task createTask(String theName) { ifSshLoadTaskDef(theName); Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; }
/** * {@inheritDoc} */ @Override public Task createTask(String theName) { ifSshLoadTaskDef(theName); Task retVal = this.currentProject.createTask(theName); if (retVal != null) { retVal.setTaskName(this.currentTaskName); retVal.setLocation(this.currentLocation); retVal.setOwningTarget(this.currentOwningTarget); } return retVal; }