View Javadoc

1   /*
2    *  Copyright (c) 2008 Rodrigo Ruiz
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  package org.apache.axis.message.addressing.tools.wsdl;
17  
18  import org.apache.axis.wsdl.gen.Parser;
19  import org.apache.axis.wsdl.toJava.Emitter;
20  
21  /**
22   * Extends Axis <i>WSDL2Java</i> tool. In addition to the code generated
23   * by standard Axis <i>WSDL2Java</i> tool, this tool generates client-side
24   * &lt;Service&gt;AddressingLocator and &lt;Service&gt;Addressing classes.
25   * The AddressingLocator can be used to get a Stub for the given PortType
26   * by passing a <i>EndpointReferenceType</i>.
27   *
28   * @author Jarek Gawor
29   * @version $Revision: 14 $
30   */
31  public class WSDL2Java extends org.apache.axis.wsdl.WSDL2Java {
32  
33    /**
34     * {@inheritDoc}
35     */
36    @Override
37    protected Parser createParser() {
38      Emitter emitter = (Emitter) super.createParser();
39      emitter.setFactory(new JavaAddressingGeneratorFactory(emitter));
40      return emitter;
41    }
42  
43    /**
44     * Application entry point.
45     *
46     * @param args Command line arguments
47     */
48    public static void main(String[] args) {
49      WSDL2Java gsdl2java = new WSDL2Java();
50      gsdl2java.run(args);
51    }
52  
53  }