KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > beehive > wsm > axis > ant > WSDL2AJavaTask


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

21 package org.apache.beehive.wsm.axis.ant;
22
23 import java.io.File JavaDoc;
24
25
26
27 import org.apache.tools.ant.AntClassLoader;
28 import org.apache.tools.ant.BuildException;
29 import org.apache.tools.ant.taskdefs.Java;
30 import org.apache.tools.ant.types.Path;
31 import org.apache.tools.ant.types.Reference;
32
33
34 public class WSDL2AJavaTask extends Java {
35     File JavaDoc mWSDL, mOutDir;
36
37     
38     public void setWSDLFile(File JavaDoc wsdl) {
39         mWSDL = wsdl;
40     }
41
42     public void setOutputDir(File JavaDoc outputDir) {
43         mOutDir = outputDir;
44     }
45     
46     /**
47      * Classpath to use, by reference.
48      *
49      * @param r a reference to an existing classpath
50      */

51     public void setClasspathRef(Reference r) {
52         super.setClasspathRef(r);
53     }
54     
55     /**
56      * Set the classpath to be used when running the Java class
57      *
58      * @param s an Ant Path object containing the classpath.
59      */

60     public void setClasspath(Path s) {
61         super.setClasspath(s);
62     }
63     /**
64      *
65      */

66     public WSDL2AJavaTask() {
67         super();
68         // TODO Auto-generated constructor stub
69
}
70     
71        public void execute() throws BuildException {
72         try {
73                 setClassname("org.apache.beehive.wsm.axis.tools.Wsdl2AJava");
74                 setArgs(mWSDL.getCanonicalPath());
75                 setArgs(mOutDir.getCanonicalPath());
76                 super.execute();
77                 
78         }
79         catch (Throwable JavaDoc e) {
80             e.printStackTrace();
81             if (e instanceof BuildException) {
82                 throw (BuildException)e;
83             }
84             else {
85                 throw new BuildException(e.toString(), e);
86             }
87         }
88     }
89 }
90
Popular Tags