Author: mmerz Date: Mon Jan 10 19:29:23 2005 New Revision: 124868 URL: http://svn.apache.org/viewcvs?view=rev&rev=124868 Log: Added ant task for creating annotated java from wsdl
Contributor: Daryoush Mehrtash Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDL2AJavaTask.java Added: incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDL2AJavaTask.java Url: http://svn.apache.org/viewcvs/incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDL2AJavaTask.java?view=auto&rev=124868 ============================================================================== --- (empty file) +++ incubator/beehive/trunk/wsm/src/runtime/org/apache/beehive/wsm/axis/ant/WSDL2AJavaTask.java Mon Jan 10 19:29:23 2005 @@ -0,0 +1,89 @@ +/* + * AxisTypeGeneratorTask.java + * + * Copyright 2001-2004 The Apache Software Foundation. + * + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * + */ +package org.apache.beehive.wsm.axis.ant; + +import java.io.File; + + +import org.apache.beehive.wsm.jsr181.wsdl.Wsdl2AJava; +import org.apache.tools.ant.AntClassLoader; +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.taskdefs.Java; +import org.apache.tools.ant.types.Path; +import org.apache.tools.ant.types.Reference; + + +public class WSDL2AJavaTask extends Java { + File mWSDL, mOutDir; + + + public void setWSDLFile(File wsdl) { + mWSDL = wsdl; + } + + public void setOutputDir(File outputDir) { + mOutDir = outputDir; + } + + /** + * Classpath to use, by reference. + * + * @param r a reference to an existing classpath + */ + public void setClasspathRef(Reference r) { + super.setClasspathRef(r); + } + + /** + * Set the classpath to be used when running the Java class + * + * @param s an Ant Path object containing the classpath. + */ + public void setClasspath(Path s) { + super.setClasspath(s); + } + /** + * + */ + public WSDL2AJavaTask() { + super(); + // TODO Auto-generated constructor stub + } + + public void execute() throws BuildException { + try { + setClassname("org.apache.beehive.wsm.jsr181.wsdl.Wsdl2AJava"); + setArgs(mWSDL.getCanonicalPath()); + setArgs(mOutDir.getCanonicalPath()); + super.execute(); + + } + catch (Throwable e) { + e.printStackTrace(); + if (e instanceof BuildException) { + throw (BuildException)e; + } + else { + throw new BuildException(e.toString(), e); + } + } + } +}
