KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > taskdefs > optional > ide > VAJLoad


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */

17
18 package org.apache.tools.ant.taskdefs.optional.ide;
19
20 import java.util.Vector JavaDoc;
21 import org.apache.tools.ant.BuildException;
22
23 /**
24  * Load project versions into the Visual Age for Java workspace.
25  * Each project is identified by its name and a version qualifier.
26  * Allowed qualifiers are:
27  * <ul>
28  * <li>Any valid Visual Age version name</li>
29  * <li>* (loads the latest <b>versioned</b> edition)</li>
30  * <li>** (loads the latest edition, including open editions)</li>
31  * </ul>
32  * Example:
33  * <blockquote>
34  * &lt;vajload&gt;
35  * &nbsp;&lt;project name=&quot;MyVAProject&quot; version=&quot;*&quot;/&gt;
36  * &nbsp;&lt;project name=&quot;Apache Xerces&quot; version=&quot;1.2.0&quot;/&gt;
37  * &nbsp;&lt;project name=&quot;Brand New Stuff&quot; version=&quot;**&quot;/&gt;
38  * &lt;/vajload&gt;
39  * </blockquote>
40  *
41  * <p>Parameters:</p>
42  * <table border="1" cellpadding="2" cellspacing="0">
43  * <tr>
44  * <td valign="top"><b>Attribute</b></td>
45  * <td valign="top"><b>Description</b></td>
46  * <td align="center" valign="top"><b>Required</b></td>
47  * </tr>
48  * <tr>
49  * <td valign="top">remote</td>
50  * <td valign="top">remote tool server to run this command against
51  * (format: &lt;servername&gt; : &lt;port no&gt;)</td>
52  * <td align="center" valign="top">No</td>
53  * </tr>
54  * <tr>
55  * <td valign="top">haltonerror</td>
56  * <td valign="top">stop the build process if an error occurs,
57  * defaults to "yes"</td>
58  * <td align="center" valign="top">No</td>
59  * </tr>
60  * </table>
61  * </p>
62  *
63  */

64
65 public class VAJLoad extends VAJTask {
66     Vector JavaDoc projectDescriptions = new Vector JavaDoc();
67
68     /**
69      * Load specified projects.
70      */

71     public void execute() {
72         try {
73             getUtil().loadProjects(projectDescriptions);
74         } catch (BuildException ex) {
75             if (haltOnError) {
76                 throw ex;
77             } else {
78                 log(ex.toString());
79             }
80         }
81     }
82
83     /**
84      * Add a project description entry on the project list.
85      * @return a project description
86      */

87     public VAJProjectDescription createVAJProject() {
88         VAJProjectDescription d = new VAJProjectDescription();
89         projectDescriptions.addElement(d);
90         return d;
91     }
92 }
93
Popular Tags