public class TryTask
extends org.apache.tools.ant.Task
implements org.apache.tools.ant.TaskContainer
| Constructor and Description |
|---|
TryTask() |
| Modifier and Type | Method and Description |
|---|---|
void |
addCatch(CatchTask task) |
void |
addFinally(FinallyTask task) |
void |
addTask(org.apache.tools.ant.Task task)
Add a nested task to Try.
|
void |
execute()
Try to execute all tasks.
|
void |
init()
make sure dependent tasks are loaded
|
void |
maybeConfigure()
Override
maybeConfigure
in a way that leaves the nested tasks unconfigured until they get
executed. |
void |
setBreak(boolean b)
A try block may contain several tasks.
|
void |
setMessageproperty(java.lang.String name)
the error message of the exception can be stored as a property
|
void |
setPrintmessage(boolean b)
If printstacktrace is set to true, this is ignored as the error message is
printed as part of the stack trace.
|
void |
setPrintstacktrace(boolean b)
Default is to not print the stack trace.
|
void |
setStacktraceproperty(java.lang.String name)
the stack trace can be stored as a property
|
bindToOwner, getOwningTarget, getRuntimeConfigurableWrapper, getTaskName, getTaskType, getWrapper, handleErrorFlush, handleErrorOutput, handleFlush, handleInput, handleOutput, isInvalid, log, log, log, log, perform, reconfigure, setOwningTarget, setRuntimeConfigurableWrapper, setTaskName, setTaskTypepublic void init()
init in class org.apache.tools.ant.Taskpublic void maybeConfigure()
throws org.apache.tools.ant.BuildException
maybeConfigure
in a way that leaves the nested tasks unconfigured until they get
executed.maybeConfigure in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - Description of Exceptionpublic void addTask(org.apache.tools.ant.Task task)
addTask in interface org.apache.tools.ant.TaskContainertask - Nested task to try to executepublic void addCatch(CatchTask task)
public void addFinally(FinallyTask task)
public void setBreak(boolean b)
b - if set to false, the try block will execute all tasks in the
block, regardless of failure of an individual task.public void setPrintmessage(boolean b)
b - Should the error message of a failed task be logged?public void setMessageproperty(java.lang.String name)
public void setPrintstacktrace(boolean b)
b - Should the stack trace of a failed task be logged?public void setStacktraceproperty(java.lang.String name)
public void execute()
throws org.apache.tools.ant.BuildException
execute in class org.apache.tools.ant.Taskorg.apache.tools.ant.BuildException - Description of Exception