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

All Implemented Interfaces:
    TypeAdapter, Cloneable

Uses introspection to "adapt" an arbitrary Bean which doesn't itself extend Task, but still contains an execute method and optionally a setProject method.
Fields inherited from org.apache.tools.ant.Task:
target,  taskName,  taskType,  wrapper
Fields inherited from org.apache.tools.ant.ProjectComponent:
project,  location,  description
Constructor:
 public TaskAdapter() 
 public TaskAdapter(Object proxy) 
    Constructor for given proxy. So you could write easier code
    myTaskContainer.addTask( new TaskAdapter(myProxy) );
    
    Parameters:
    proxy - The object which Ant should use as task.
Method from org.apache.tools.ant.TaskAdapter Summary:
checkProxyClass,   checkTaskClass,   execute,   getProxy,   setProxy
Methods from org.apache.tools.ant.Task:
bindToOwner,   execute,   getOwningTarget,   getRuntimeConfigurableWrapper,   getTaskName,   getTaskType,   getWrapper,   handleErrorFlush,   handleErrorOutput,   handleFlush,   handleInput,   handleOutput,   init,   isInvalid,   log,   log,   log,   log,   markInvalid,   maybeConfigure,   perform,   reconfigure,   setOwningTarget,   setRuntimeConfigurableWrapper,   setTaskName,   setTaskType
Methods from org.apache.tools.ant.ProjectComponent:
clone,   getDescription,   getLocation,   getProject,   log,   log,   setDescription,   setLocation,   setProject
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.tools.ant.TaskAdapter Detail:
 public  void checkProxyClass(Class proxyClass) 
    Check if the proxy class is a valid class to use with this adapter. The class must have a public no-arg "execute()" method.
 public static  void checkTaskClass(Class taskClass,
    Project project) 
    Checks whether or not a class is suitable to be adapted by TaskAdapter. If the class is of type Dispatchable, the check is not performed because the method that will be executed will be determined only at runtime of the actual task and not during parse time. This only checks conditions which are additionally required for tasks adapted by TaskAdapter. Thus, this method should be called by Project.checkTaskClass. Throws a BuildException and logs as Project.MSG_ERR for conditions that will cause the task execution to fail. Logs other suspicious conditions with Project.MSG_WARN.
 public  void execute() throws BuildException 
    Executes the proxied task.
 public Object getProxy() 
    Returns the target object being proxied.
 public  void setProxy(Object o) 
    Sets the target object to proxy for.