001package net.gdface.codegen.webclient;
002
003import org.apache.commons.cli.Options;
004
005import net.gdface.cli.Context;
006import net.gdface.codegen.generator.GeneratorConfiguration;
007
008public class KSoapClientGenerator extends WebClientGenerator {
009        private final KSoapClientOptions options = KSoapClientOptions.getInstance();
010        protected KSoapClientConfiguration config;
011
012        public KSoapClientGenerator() {
013                config = new KSoapClientConfiguration();
014        }
015
016        public static void main(String[] args) {
017                new KSoapClientGenerator().parseCommandLine(args).initEngine().generate();
018        }
019
020        @SuppressWarnings({ "unchecked", "rawtypes" })
021        @Override
022        protected Context createEngineContext() {
023                Context context = super.createEngineContext();
024                KSoapClient newSourceInfo = new KSoapClient(config.getInterfaceClass(), config.getRefClass(),
025                                config.getServiceClass(), config.getServiceName(), config.getStubPackage());
026                if (!newSourceInfo.compile())
027                        System.exit(1);
028                context.setProperty(SOURCE_INFO, newSourceInfo);
029                return context;
030        }
031
032        @Override
033        protected Options getOptions() {
034                return options.getOptions();
035        }
036
037        @Override
038        protected GeneratorConfiguration getGeneratorConfiguration() {
039                return config;
040        }
041
042}