protoj.core.internal
Class AntTarget

java.lang.Object
  extended by protoj.core.internal.AntTarget

public final class AntTarget
extends java.lang.Object

A convenience class that hides some of the details of interacting with ant programmatically. An ant task wrapper will typically hold and instance of this class to ease implementation.

This class effectively mimicks an ant script that contains an outer project element which in turn contains a single inner target element. The addTask(Task) method is used to provide the individual ant task elements that should make up that target element.

Author:
Ashley Williams

Constructor Summary
AntTarget(java.lang.String name)
          The name of a target can appear in log4j reports for example so bear this in mind when choosing one.
 
Method Summary
 void addTask(org.apache.tools.ant.Task task)
          Adds a task sequentially to the underlying ant target.
 void execute()
          Executes the underlying ant target.
 java.lang.String getName()
           
 org.apache.tools.ant.Project getProject()
           
 org.apache.tools.ant.Target getTarget()
           
 void initLogging(java.io.File logFile, int level)
          Enables logging to the specified log file at the specified level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AntTarget

public AntTarget(java.lang.String name)
The name of a target can appear in log4j reports for example so bear this in mind when choosing one.

Parameters:
name -
Method Detail

initLogging

public void initLogging(java.io.File logFile,
                        int level)
Enables logging to the specified log file at the specified level.

Parameters:
logFile - the file to log to
level - one of the org.apache.tools.ant.Project.MSG_XXX logging levels

addTask

public void addTask(org.apache.tools.ant.Task task)
Adds a task sequentially to the underlying ant target.

Parameters:
task -

execute

public void execute()
Executes the underlying ant target. Any tasks attached to the target will therefore be executed.


getTarget

public org.apache.tools.ant.Target getTarget()

getProject

public org.apache.tools.ant.Project getProject()

getName

public java.lang.String getName()