01: /*
02: * Copyright 2001-2004 The Apache Software Foundation.
03: *
04: * Licensed under the Apache License, Version 2.0 (the "License");
05: * you may not use this file except in compliance with the License.
06: * You may obtain a copy of the License at
07: *
08: * http://www.apache.org/licenses/LICENSE-2.0
09: *
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 samples.integrationGuide.example2;
17:
18: import org.apache.axis.utils.CLOption;
19: import org.apache.axis.utils.CLOptionDescriptor;
20: import org.apache.axis.wsdl.WSDL2Java;
21: import org.apache.axis.wsdl.gen.Parser;
22:
23: public class WSDL2Useless extends WSDL2Java {
24:
25: protected static final int SONG_OPT = 'g';
26:
27: protected static final CLOptionDescriptor[] options = new CLOptionDescriptor[] { new CLOptionDescriptor(
28: "song", CLOptionDescriptor.ARGUMENT_REQUIRED, SONG_OPT,
29: "Choose a song for deploy.useless: work or rum") };
30:
31: public WSDL2Useless() {
32: addOptions(options);
33: } // ctor
34:
35: protected Parser createParser() {
36: return new MyEmitter();
37: } // createParser
38:
39: protected void parseOption(CLOption option) {
40: if (option.getId() == SONG_OPT) {
41: String arg = option.getArgument();
42: if (arg.equals("rum")) {
43: ((MyEmitter) parser).setSong(MyEmitter.RUM);
44: } else if (arg.equals("work")) {
45: ((MyEmitter) parser).setSong(MyEmitter.WORK);
46: }
47: } else {
48: super .parseOption(option);
49: }
50: } // parseOption
51:
52: /**
53: * Main
54: */
55: public static void main(String args[]) {
56: WSDL2Useless useless = new WSDL2Useless();
57:
58: useless.run(args);
59: } // main
60: } // class WSDL2Useless
|