Java Doc for Task.java in  » Build » ANT » org » apache » tools » ant » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Build » ANT » org.apache.tools.ant 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.tools.ant.ProjectComponent
      org.apache.tools.ant.Task

All known Subclasses:   org.apache.tools.ant.taskdefs.optional.Javah,  org.apache.tools.ant.taskdefs.optional.Script,  org.apache.tools.ant.taskdefs.Tstamp,  org.apache.tools.ant.taskdefs.optional.scm.AntStarTeamCheckOut,  org.apache.tools.ant.taskdefs.Filter,  org.apache.tools.ant.taskdefs.Exec,  org.apache.tools.ant.taskdefs.KeySubst,  org.apache.tools.ant.taskdefs.Concat,  org.apache.tools.ant.taskdefs.optional.ANTLR,  org.apache.tools.ant.taskdefs.optional.ejb.WLRun,  org.apache.tools.ant.DummyTaskAbstract,  org.apache.tools.ant.taskdefs.optional.net.RExecTask,  org.apache.tools.ant.UnknownElement,  org.apache.tools.ant.taskdefs.optional.ssh.SSHBase,  org.apache.tools.ant.taskdefs.BuildNumber,  org.apache.tools.ant.taskdefs.Input,  org.apache.tools.ant.DummyTaskWithoutPublicConstructor,  org.apache.tools.ant.taskdefs.optional.javacc.JJTree,  org.apache.tools.ant.taskdefs.PathConvert,  org.apache.tools.ant.taskdefs.optional.starteam.StarTeamTask,  org.apache.tools.ant.taskdefs.TempFile,  org.apache.tools.ant.taskdefs.optional.extension.JarLibAvailableTask,  org.apache.tools.ant.taskdefs.Javadoc,  org.apache.tools.ant.taskdefs.optional.j2ee.ServerDeploy,  org.apache.tools.ant.taskdefs.Get,  org.apache.tools.ant.taskdefs.Property,  org.apache.tools.ant.taskdefs.optional.ejb.WLStop,  org.apache.tools.ant.taskdefs.MatchingTask,  org.apache.tools.ant.taskdefs.optional.pvcs.Pvcs,  org.apache.tools.ant.taskdefs.optional.javacc.JavaCC,  org.apache.tools.ant.taskdefs.Dirname,  org.apache.tools.ant.taskdefs.Patch,  org.apache.tools.ant.taskdefs.SubAnt,  org.apache.tools.ant.taskdefs.optional.splash.SplashTask,  org.apache.tools.ant.taskdefs.LoadProperties,  org.apache.tools.ant.taskdefs.Antlib,  org.apache.tools.ant.taskdefs.ManifestTask,  org.apache.tools.ant.taskdefs.CallTarget,  org.apache.tools.ant.taskdefs.Echo,  org.apache.tools.ant.taskdefs.Recorder,  org.apache.tools.ant.taskdefs.optional.Rpm,  org.apache.tools.ant.dispatch.DispatchTask,  org.apache.tools.ant.taskdefs.optional.net.TelnetTask,  org.apache.tools.ant.taskdefs.Mkdir,  org.apache.tools.ant.taskdefs.Java,  org.apache.tools.ant.taskdefs.Sleep,  org.apache.tools.ant.taskdefs.email.EmailTask,  org.apache.tools.ant.taskdefs.Ant,  org.apache.tools.ant.taskdefs.optional.net.FTP,  org.apache.tools.ant.taskdefs.Nice,  org.apache.tools.ant.DummyTaskOk,  org.apache.tools.ant.taskdefs.optional.ccm.Continuus,  org.apache.tools.ant.taskdefs.Exit,  org.apache.tools.ant.taskdefs.AbstractJarSignerTask,  org.apache.tools.ant.taskdefs.optional.junit.JUnitTask,  org.apache.tools.ant.taskdefs.optional.net.SetProxy,  org.apache.tools.ant.taskdefs.optional.jdepend.JDependTask,  org.apache.tools.ant.taskdefs.optional.extension.JarLibDisplayTask,  org.apache.tools.ant.taskdefs.optional.dotnet.WsdlToDotnet,  org.apache.tools.ant.taskdefs.Sequential,  task.BaseTask,  org.apache.tools.ant.taskdefs.Copy,  org.apache.tools.ant.taskdefs.DiagnosticsTask,  org.apache.tools.ant.taskdefs.Length,  org.apache.tools.ant.taskdefs.Classloader,  org.apache.tools.ant.taskdefs.Sync,  org.apache.tools.ant.taskdefs.optional.javacc.JJDoc,  org.apache.tools.ant.taskdefs.Copyfile,  org.apache.tools.ant.taskdefs.GenerateKey,  org.apache.tools.ant.taskdefs.CVSPass,  org.apache.tools.ant.taskdefs.DefaultExcludes,  org.apache.tools.ant.taskdefs.ManifestClassPath,  org.apache.tools.ant.taskdefs.ResourceCount,  org.apache.tools.ant.taskdefs.DynamicTask,  org.apache.tools.ant.taskdefs.optional.perforce.P4Base,  org.apache.tools.ant.DummyTaskWithoutDefaultConstructor,  task.EchoLocation,  org.apache.tools.ant.taskdefs.optional.script.ScriptDefBase,  org.apache.tools.ant.taskdefs.Pack,  org.apache.tools.ant.taskdefs.JDBCTask,  org.apache.tools.ant.taskdefs.ExecTask,  org.apache.tools.ant.taskdefs.Unpack,  org.apache.tools.ant.taskdefs.optional.sos.SOS,  org.apache.tools.ant.taskdefs.optional.EchoProperties,  org.apache.tools.ant.taskdefs.optional.clearcase.ClearCase,  org.apache.tools.ant.taskdefs.Deltree,  org.apache.tools.ant.taskdefs.Touch,  org.apache.tools.ant.taskdefs.optional.ReplaceRegExp,  org.apache.tools.ant.taskdefs.Available,  org.apache.tools.ant.taskdefs.optional.dotnet.ImportTypelib,  org.apache.tools.ant.taskdefs.optional.PropertyFile,  org.apache.tools.ant.taskdefs.AbstractCvsTask,  org.apache.tools.ant.taskdefs.DemuxOutputTask,  org.apache.tools.ant.taskdefs.XmlProperty,  org.apache.tools.ant.taskdefs.optional.dotnet.Ildasm,  org.apache.tools.ant.taskdefs.Rename,  org.apache.tools.ant.taskdefs.optional.vss.MSVSS,  org.apache.tools.ant.taskdefs.WhichResource,  org.apache.tools.ant.TaskAdapter,  org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator,  org.apache.tools.ant.taskdefs.optional.sound.SoundTask,  org.apache.tools.ant.taskdefs.MacroInstance,  org.apache.tools.ant.taskdefs.AntlibDefinition,  org.apache.tools.ant.taskdefs.optional.extension.JarLibManifestTask,  org.apache.tools.ant.taskdefs.Expand,  org.apache.tools.ant.taskdefs.optional.extension.JarLibResolveTask,  org.apache.tools.ant.taskdefs.MakeUrl,  org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient,  org.apache.tools.ant.types.mappers.MapperResult,  org.apache.tools.ant.taskdefs.CopyPath,  org.apache.tools.ant.taskdefs.Parallel,  org.apache.tools.ant.taskdefs.AntStructure,  org.apache.tools.ant.taskdefs.Basename,  org.apache.tools.ant.taskdefs.LoadResource,  org.apache.tools.ant.taskdefs.UpToDate,  org.example.tasks.TaskdefTestSimpleTask,  org.apache.tools.ant.taskdefs.ImportTask,  org.apache.tools.ant.taskdefs.optional.ejb.IPlanetEjbcTask,  org.apache.tools.ant.taskdefs.optional.XMLValidateTask,
Task
abstract public class Task extends ProjectComponent (Code)
Base class for all tasks. Use Project.createTask to create a new task instance rather than using this class directly for construction.
See Also:   Project.createTask


Field Summary
protected  Targettarget
     Target this task belongs to, if any.
protected  StringtaskName
     Name of this task to be used for logging purposes. This defaults to the same as the type, but may be overridden by the user.
protected  StringtaskType
     Type of this task.
protected  RuntimeConfigurablewrapper
     Wrapper for this object, used to configure it at runtime.

Constructor Summary
public  Task()
     Sole constructor.

Method Summary
final public  voidbindToOwner(Task owner)
     Bind a task to another; use this when configuring a newly created task to do work on behalf of another.
public  voidexecute()
     Called by the project to let the task do its work.
public  TargetgetOwningTarget()
     Returns the container target of this task.
public  RuntimeConfigurablegetRuntimeConfigurableWrapper()
     Returns the wrapper used for runtime configuration. the wrapper used for runtime configuration.
public  StringgetTaskName()
     Returns the name to use in logging messages.
public  StringgetTaskType()
     Return the type of task.
protected  RuntimeConfigurablegetWrapper()
     Return the runtime configurable structure for this task.
protected  voidhandleErrorFlush(String output)
     Handles an error line by logging it with the WARN priority.
Parameters:
  output - The error output to log.
protected  voidhandleErrorOutput(String output)
     Handles an error output by logging it with the WARN priority.
Parameters:
  output - The error output to log.
protected  voidhandleFlush(String output)
     Handles output by logging it with the INFO priority.
Parameters:
  output - The output to log.
protected  inthandleInput(byte[] buffer, int offset, int length)
     Handle an input request by this task.
Parameters:
  buffer - the buffer into which data is to be read.
Parameters:
  offset - the offset into the buffer at which data is stored.
Parameters:
  length - the amount of data to read.
protected  voidhandleOutput(String output)
     Handles output by logging it with the INFO priority.
Parameters:
  output - The output to log.
public  voidinit()
     Called by the project to let the task initialize properly.
final protected  booleanisInvalid()
     Has this task been marked invalid? true if this task is no longer valid.
public  voidlog(String msg)
     Logs a message with the default (INFO) priority.
Parameters:
  msg - The message to be logged.
public  voidlog(String msg, int msgLevel)
     Logs a message with the given priority.
public  voidlog(Throwable t, int msgLevel)
     Logs a message with the given priority.
public  voidlog(String msg, Throwable t, int msgLevel)
     Logs a message with the given priority.
final  voidmarkInvalid()
     Marks this task as invalid.
public  voidmaybeConfigure()
     Configures this task - if it hasn't been done already.
final public  voidperform()
     Performs this task if it's still valid, or gets a replacement version and performs that otherwise. Performing a task consists of firing a task started event, configuring the task, executing it, and then firing task finished event.
public  voidreconfigure()
     Force the task to be reconfigured from its RuntimeConfigurable.
public  voidsetOwningTarget(Target target)
     Sets the target container of this task.
public  voidsetRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)
     Sets the wrapper to be used for runtime configuration.
public  voidsetTaskName(String name)
     Sets the name to use in logging messages.
public  voidsetTaskType(String type)
     Sets the name with which the task has been invoked.

Field Detail
target
protected Target target(Code)
Target this task belongs to, if any. Task.getOwningTarget()



taskName
protected String taskName(Code)
Name of this task to be used for logging purposes. This defaults to the same as the type, but may be overridden by the user. For instance, the name "java" isn't terribly descriptive for a task used within another task - the outer task code can probably provide a better one. Task.getTaskName()



taskType
protected String taskType(Code)
Type of this task. Task.getTaskType()



wrapper
protected RuntimeConfigurable wrapper(Code)
Wrapper for this object, used to configure it at runtime. Task.getWrapper()




Constructor Detail
Task
public Task()(Code)
Sole constructor.




Method Detail
bindToOwner
final public void bindToOwner(Task owner)(Code)
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 Task.init . If you are creating a task to delegate work to, call Task.init to initialize it.
Parameters:
  owner - owning target
since:
   Ant1.7



execute
public void execute() throws BuildException(Code)
Called by the project to let the task do its work. This method may be called more than once, if the task is invoked more than once. For example, if target1 and target2 both depend on target3, then running "ant target1 target2" will run all tasks in target3 twice.
exception:
  BuildException - if something goes wrong with the build.



getOwningTarget
public Target getOwningTarget()(Code)
Returns the container target of this task. The target containing this task, or null ifthis task is a top-level task.



getRuntimeConfigurableWrapper
public RuntimeConfigurable getRuntimeConfigurableWrapper()(Code)
Returns the wrapper used for runtime configuration. the wrapper used for runtime configuration. Thismethod will generate a new wrapper (and cache it)if one isn't set already.



getTaskName
public String getTaskName()(Code)
Returns the name to use in logging messages. the name to use in logging messages.



getTaskType
public String getTaskType()(Code)
Return the type of task. the type of task.



getWrapper
protected RuntimeConfigurable getWrapper()(Code)
Return the runtime configurable structure for this task. the runtime structure for this task.



handleErrorFlush
protected void handleErrorFlush(String output)(Code)
Handles an error line by logging it with the WARN priority.
Parameters:
  output - The error output to log. Should not be null.
since:
   Ant 1.5.2



handleErrorOutput
protected void handleErrorOutput(String output)(Code)
Handles an error output by logging it with the WARN priority.
Parameters:
  output - The error output to log. Should not be null.



handleFlush
protected void handleFlush(String output)(Code)
Handles output by logging it with the INFO priority.
Parameters:
  output - The output to log. Should not be null.
since:
   Ant 1.5.2



handleInput
protected int handleInput(byte[] buffer, int offset, int length) throws IOException(Code)
Handle an input request by this task.
Parameters:
  buffer - the buffer into which data is to be read.
Parameters:
  offset - the offset into the buffer at which data is stored.
Parameters:
  length - the amount of data to read. the number of bytes read.
exception:
  IOException - if the data cannot be read.
since:
   Ant 1.6



handleOutput
protected void handleOutput(String output)(Code)
Handles output by logging it with the INFO priority.
Parameters:
  output - The output to log. Should not be null.



init
public void init() throws BuildException(Code)
Called by the project to let the task initialize properly. The default implementation is a no-op.
exception:
  BuildException - if something goes wrong with the build



isInvalid
final protected boolean isInvalid()(Code)
Has this task been marked invalid? true if this task is no longer valid. A new task should beconfigured in this case.
since:
   Ant 1.5



log
public void log(String msg)(Code)
Logs a message with the default (INFO) priority.
Parameters:
  msg - The message to be logged. Should not be null.



log
public void log(String msg, int msgLevel)(Code)
Logs a message with the given priority. This delegates the actual logging to the project.
Parameters:
  msg - The message to be logged. Should not be null.
Parameters:
  msgLevel - The message priority at which this message is tobe logged.



log
public void log(Throwable t, int msgLevel)(Code)
Logs a message with the given priority. This delegates the actual logging to the project.
Parameters:
  t - The exception to be logged. Should not be null.
Parameters:
  msgLevel - The message priority at which this message is tobe logged.
since:
   1.7



log
public void log(String msg, Throwable t, int msgLevel)(Code)
Logs a message with the given priority. This delegates the actual logging to the project.
Parameters:
  msg - The message to be logged. Should not be null.
Parameters:
  t - The exception to be logged. May be null.
Parameters:
  msgLevel - The message priority at which this message is tobe logged.
since:
   1.7



markInvalid
final void markInvalid()(Code)
Marks this task as invalid. Any further use of this task will go through a replacement with the updated definition.



maybeConfigure
public void maybeConfigure() throws BuildException(Code)
Configures this task - if it hasn't been done already. If the task has been invalidated, it is replaced with an UnknownElement task which uses the new definition in the project.
exception:
  BuildException - if the task cannot be configured.



perform
final public void perform()(Code)
Performs this task if it's still valid, or gets a replacement version and performs that otherwise. Performing a task consists of firing a task started event, configuring the task, executing it, and then firing task finished event. If a runtime exception is thrown, the task finished event is still fired, but with the exception as the cause.



reconfigure
public void reconfigure()(Code)
Force the task to be reconfigured from its RuntimeConfigurable.



setOwningTarget
public void setOwningTarget(Target target)(Code)
Sets the target container of this task.
Parameters:
  target - Target in whose scope this task belongs.May be null, indicating a top-level task.



setRuntimeConfigurableWrapper
public void setRuntimeConfigurableWrapper(RuntimeConfigurable wrapper)(Code)
Sets the wrapper to be used for runtime configuration. This method should be used only by the ProjectHelper and Ant internals. It is public to allow helper plugins to operate on tasks, normal tasks should never use it.
Parameters:
  wrapper - The wrapper to be used for runtime configuration.May be null, in which case the next callto getRuntimeConfigurableWrapper will generate a newwrapper.



setTaskName
public void setTaskName(String name)(Code)
Sets the name to use in logging messages.
Parameters:
  name - The name to use in logging messages.Should not be null.



setTaskType
public void setTaskType(String type)(Code)
Sets the name with which the task has been invoked.
Parameters:
  type - The name the task has been invoked as.Should not be null.



Fields inherited from org.apache.tools.ant.ProjectComponent
protected String description(Code)(Java Doc)
protected Location location(Code)(Java Doc)
protected Project project(Code)(Java Doc)

Methods inherited from org.apache.tools.ant.ProjectComponent
public Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public String getDescription()(Code)(Java Doc)
public Location getLocation()(Code)(Java Doc)
public Project getProject()(Code)(Java Doc)
public void log(String msg)(Code)(Java Doc)
public void log(String msg, int msgLevel)(Code)(Java Doc)
public void setDescription(String desc)(Code)(Java Doc)
public void setLocation(Location location)(Code)(Java Doc)
public void setProject(Project project)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.