01: // THIS SOFTWARE IS PROVIDED BY SOFTARIS PTY.LTD. AND OTHER METABOSS
02: // CONTRIBUTORS ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING,
03: // BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
04: // FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SOFTARIS PTY.LTD.
05: // OR OTHER METABOSS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
06: // INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
07: // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
08: // OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
09: // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
10: // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
11: // EVEN IF SOFTARIS PTY.LTD. OR OTHER METABOSS CONTRIBUTORS ARE ADVISED OF THE
12: // POSSIBILITY OF SUCH DAMAGE.
13: //
14: // Copyright 2000-2005 © Softaris Pty.Ltd. All Rights Reserved.
15: package com.metaboss.sdlctools.applications.anttasks.builder.tools;
16:
17: import org.apache.tools.ant.BuildException;
18: import org.apache.tools.ant.Task;
19:
20: import com.metaboss.sdlctools.applications.anttasks.builder.MetaBossBuilderTask;
21: import com.metaboss.sdlctools.applications.anttasks.builder.ToolInvocationDefinition;
22:
23: /** This definition is responsible for invocation of any AntTask */
24: public class AntTaskInvocationDefinition extends
25: ToolInvocationDefinition {
26: private Task mTask = null;
27:
28: /** Public constructor for the invocation */
29: public AntTaskInvocationDefinition(MetaBossBuilderTask pOwnerTask,
30: String pTaskName) {
31: super (pOwnerTask, pTaskName);
32: }
33:
34: /** Setter for the Task to execute */
35: public void setTask(Task pTask) {
36: mTask = pTask;
37: }
38:
39: /** Sets the destination archive file name */
40: public Task getTask() {
41: if (mTask == null)
42: throw new BuildException(
43: "Missing Task, which is mandatory for ant task invocation.");
44: return mTask;
45: }
46:
47: /** Overridden to compare details of the invocation */
48: public boolean equals(Object pOther) {
49: if (this == pOther)
50: return true;
51: return false;
52: }
53:
54: /** This method will have to invoke the generator */
55: public void invoke() throws BuildException {
56: getTask().execute();
57: }
58: }
|