01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.geronimo.jaxws.builder;
21:
22: import org.apache.geronimo.gshell.command.CommandContext;
23: import org.apache.geronimo.gshell.command.CommandSupport;
24: import org.apache.geronimo.gshell.command.annotation.CommandComponent;
25: import org.apache.geronimo.gshell.command.annotation.Requirement;
26: import org.apache.geronimo.gshell.shell.ShellInfo;
27:
28: /**
29: * GShell command for wsimport tool.
30: *
31: * @version $Rev: 595889 $ $Date: 2007-11-16 20:13:06 -0500 (Fri, 16 Nov 2007) $
32: */
33: @CommandComponent(id="geronimo-jaxws-builder:wsimport",description="Generate JAX-WS artifacts from WSDL")
34: public class WsimportCommand extends CommandSupport {
35:
36: @Requirement
37: ShellInfo shellInfo;
38:
39: @Override
40: public Object execute(final CommandContext context,
41: final Object... args) throws Exception {
42: init(context);
43:
44: String[] arguments = toString(args);
45: return JAXWSToolsCLI.run(JAXWSToolsCLI.Command.WSIMPORT,
46: shellInfo.getHomeDir().getAbsolutePath(), arguments,
47: System.out); // should use io.out instead of System.out?
48: }
49:
50: @Override
51: protected Object doExecute() throws Exception {
52: return null;
53: }
54:
55: private static String[] toString(Object[] args) {
56: String[] a = new String[args.length];
57: for (int i = 0; i < a.length; i++) {
58: a[i] = args[i].toString();
59: }
60: return a;
61: }
62:
63: }
|