private static boolean isJwsOptionEnabled(CommandLineOptionParser parser) { Map allOptions = parser.getAllOptions(); CommandLineOption option = (CommandLineOption) allOptions .get(CommandLineOptionConstants.WSDL2JavaConstants.JAX_WS_SERVICE_OPTION); if( option == null){ return false; } return true; }
private static void setSystemProperties(CommandLineOptionParser commandLineOptionParser) { Map<String, CommandLineOption> allOptions = commandLineOptionParser.getAllOptions(); // System properties follow "-Dproperty=value" format, only key is required. if (allOptions != null) { for (String key : allOptions.keySet()) { if (key != null && key.length() > 0 && key.startsWith(CommandLineOptionConstants.WSDL2JavaConstants.SYSTEM_PROPERTY_PREFIX) && key.contains("=")) { int splitIndex = key.indexOf("="); String pKey = key.substring(1, splitIndex); String pValue = key.substring(splitIndex + 1); if (pKey != null && pValue != null) { System.setProperty(pKey, pValue); } } } } }
private static boolean isOptionsValid(CommandLineOptionParser parser) { boolean isValid = true; if (parser.getInvalidOptions(new WSDL2JavaOptionsValidator()).size() > 0){ isValid = false; } if (null == parser.getAllOptions().get( CommandLineOptionConstants.WSDL2JavaConstants.WSDL_LOCATION_URI_OPTION)){ isValid = false; } return isValid; }
.getAllOptions(); List<String> axisOptionList = new ArrayList<String>(); List<String> originalArgsOps = new ArrayList<String>(
String password = null; Map allOptions = commandLineOptionParser.getAllOptions(); CommandLineOption userOption = (CommandLineOption) allOptions .get(CommandLineOptionConstants.WSDL2JavaConstants.HTTP_PROXY_USER_OPTION_LONG);
Map optionsMap = optionsParser.getAllOptions();
Map optionsMap = optionsParser.getAllOptions();
Map allOptions = commandLineOptionParser.getAllOptions();
try { CommandLineOptionParser commandLineOptionParser = new CommandLineOptionParser(args); allOptions = commandLineOptionParser.getAllOptions();
public void execute() throws BuildException { try { /* * This needs the ClassLoader we use to load the task * have all the dependancies set, hope that * is ok for now */ AntClassLoader cl = new AntClassLoader( getClass().getClassLoader(), getProject(), classpath == null ? createClasspath() : classpath, false); Thread.currentThread().setContextClassLoader(cl); Map commandLineOptions = this.fillOptionMap(); CommandLineOptionParser parser = new CommandLineOptionParser(commandLineOptions); CodeGenConfiguration config = new CodeGenConfiguration(); CodegenConfigLoader.loadConfig(config, parser.getAllOptions()); new CodeGenerationEngine(config).generate(); } catch (Throwable e) { throw new BuildException(e); } }
Map optionsMap = optionsParser.getAllOptions();
Map optionsMap = optionsParser.getAllOptions();
Map optionsMap = optionsParser.getAllOptions();
public static void main(String[] args) throws Exception { CommandLineOptionParser commandLineOptionParser = new CommandLineOptionParser( args); checkAuthentication(commandLineOptionParser); setSystemProperties(commandLineOptionParser); //If it is a JAX-WS code generation request call WSimportTool. if (isJwsOptionEnabled(commandLineOptionParser)){ new JAXWSCodeGenerationEngine(commandLineOptionParser, args).generate(); return; } if (isOptionsValid(commandLineOptionParser)){ CodeGenConfiguration config = new CodeGenConfiguration(); CodegenConfigLoader.loadConfig(config, commandLineOptionParser.getAllOptions()); new CodeGenerationEngine(config).generate(); } else { printUsage(); } }