Save This Page
Home » apache-ant-1.7.1-src » org.apache.tools » ant » [javadoc | source]
org.apache.tools.ant
public class: Target [javadoc | source]
java.lang.Object
   org.apache.tools.ant.Target

All Implemented Interfaces:
    TaskContainer

Class to implement a target object with required parameters.
Constructor:
 public Target() 
 public Target(Target other) 
    Cloning constructor.
    Parameters:
    other - the Target to clone.
Method from org.apache.tools.ant.Target Summary:
addDataType,   addDependency,   addTask,   dependsOn,   execute,   getDependencies,   getDescription,   getIf,   getLocation,   getName,   getProject,   getTasks,   getUnless,   performTasks,   replaceChild,   replaceChild,   setDepends,   setDescription,   setIf,   setLocation,   setName,   setProject,   setUnless,   toString
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.Target Detail:
 public  void addDataType(RuntimeConfigurable r) 
    Adds the wrapper for a data type element to this target.
 public  void addDependency(String dependency) 
    Adds a dependency to this target.
 public  void addTask(Task task) 
    Adds a task to this target.
 public boolean dependsOn(String other) 
    Does this target depend on the named target?
 public  void execute() throws BuildException 
    Executes the target if the "if" and "unless" conditions are satisfied. Dependency checking should be done before calling this method, as it does no checking of its own. If either the "if" or "unless" test prevents this target from being executed, a verbose message is logged giving the reason. It is recommended that clients of this class call performTasks rather than this method so that appropriate build events are fired.
 public Enumeration getDependencies() 
    Returns an enumeration of the dependencies of this target.
 public String getDescription() 
    Returns the description of this target.
 public String getIf() 
    Returns the "if" property condition of this target.
 public Location getLocation() 
    Get the location of this target's definition.
 public String getName() 
    Returns the name of this target.
 public Project getProject() 
    Returns the project this target belongs to.
 public Task[] getTasks() 
    Returns the current set of tasks to be executed by this target.
 public String getUnless() 
    Returns the "unless" property condition of this target.
 public final  void performTasks() 
    Performs the tasks within this target (if the conditions are met), firing target started/target finished messages around a call to execute.
  void replaceChild(Task el,
    RuntimeConfigurable o) 
    Replaces all occurrences of the given task in the list of children with the replacement data type wrapper.
  void replaceChild(Task el,
    Task o) 
    Replaces all occurrences of the given task in the list of children with the replacement task.
 public  void setDepends(String depS) 
    Sets the list of targets this target is dependent on. The targets themselves are not resolved at this time.
 public  void setDescription(String description) 
    Sets the description of this target.
 public  void setIf(String property) 
    Sets the "if" condition to test on execution. This is the name of a property to test for existence - if the property is not set, the task will not execute. The property goes through property substitution once before testing, so if property foo has value bar, setting the "if" condition to ${foo}_x will mean that the task will only execute if property bar_x is set.
 public  void setLocation(Location location) 
    Sets the location of this target's definition.
 public  void setName(String name) 
    Sets the name of this target.
 public  void setProject(Project project) 
    Sets the project this target belongs to.
 public  void setUnless(String property) 
    Sets the "unless" condition to test on execution. This is the name of a property to test for existence - if the property is set, the task will not execute. The property goes through property substitution once before testing, so if property foo has value bar, setting the "unless" condition to ${foo}_x will mean that the task will only execute if property bar_x isn't set.
 public String toString() 
    Returns the name of this target.