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; }
public CommandLineOptionParser(String[] args) { this.commandLineOptions = this.parse(args); }
String confLocation = null; CommandLineOptionParser optionsParser = new CommandLineOptionParser(args); List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() { public boolean isInvalid(CommandLineOption option) { String optionType = option.getOptionType(); Map optionsMap = optionsParser.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); } }
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; }
public void execute() throws MojoFailureException, MojoExecutionException { fixCompileSourceRoots(); showDependencies(); Map<String,CommandLineOption> commandLineOptions = this.fillOptionMap(); CommandLineOptionParser parser = new CommandLineOptionParser(commandLineOptions); try { new CodeGenerationEngine(parser).generate(); } catch (CodeGenerationException e) { Throwable t = e; while (t.getCause() != null) { t = t.getCause(); } t.printStackTrace(); throw new MojoExecutionException(e.getMessage(), e); } }
String confLocation = null; CommandLineOptionParser optionsParser = new CommandLineOptionParser(args); List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() { public boolean isInvalid(CommandLineOption option) { String optionType = option.getOptionType(); 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(); } }
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); } } } } }
Map allOptions; try { CommandLineOptionParser commandLineOptionParser = new CommandLineOptionParser(args); allOptions = commandLineOptionParser.getAllOptions(); List list = commandLineOptionParser.getInvalidOptions(new WSDL2JavaOptionsValidator()); if (list.size() > 0) { String faultOptions = "";
.getAllOptions(); List<String> axisOptionList = new ArrayList<String>(); List<String> originalArgsOps = new ArrayList<String>(
public CommandLineOptionParser(String[] args) { this.commandLineOptions = this.parse(args); }
String confLocation = null; CommandLineOptionParser optionsParser = new CommandLineOptionParser(args); List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() { public boolean isInvalid(CommandLineOption option) { String optionType = option.getOptionType(); Map optionsMap = optionsParser.getAllOptions();
String password = null; Map allOptions = commandLineOptionParser.getAllOptions(); CommandLineOption userOption = (CommandLineOption) allOptions .get(CommandLineOptionConstants.WSDL2JavaConstants.HTTP_PROXY_USER_OPTION_LONG);
String confLocation = null; CommandLineOptionParser optionsParser = new CommandLineOptionParser(args); List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() { public boolean isInvalid(CommandLineOption option) { String optionType = option.getOptionType(); Map optionsMap = optionsParser.getAllOptions();
Map allOptions = commandLineOptionParser.getAllOptions();
String confLocation = null; CommandLineOptionParser optionsParser = new CommandLineOptionParser(args); List invalidOptionsList = optionsParser.getInvalidOptions(new OptionsValidator() { public boolean isInvalid(CommandLineOption option) { String optionType = option.getOptionType(); Map optionsMap = optionsParser.getAllOptions();