public ToolContext getContext() { if (context == null) { context = new ToolContext(); } return context; }
public ToolContext getContext() { if (context == null) { context = new ToolContext(); } return context; }
private ToolContext getToolContext() throws IllegalStateException, IOException { if (toolContext == null) { XmlFactoryConfiguration factoryConfiguration = new XmlFactoryConfiguration("Default Tools"); factoryConfiguration.read(getServletContext().getResourceAsStream(getToolboxConfigLocation())); ToolboxFactory factory = factoryConfiguration.createFactory(); factory.configure(factoryConfiguration); toolContext = new ToolContext(); for (String scope : Scope.values()) { toolContext.addToolbox(factory.createToolbox(scope)); } } return toolContext; }
XmlFactoryConfiguration factoryConfiguration = new XmlFactoryConfiguration("Default Tools"); try { factoryConfiguration.read(new FileInputStream(new File(Thread.currentThread().getContextClassLoader().getResource("/").getFile(), TOOL_BOX_CONF_FILE))); } catch (IOException e) { e.printStackTrace(); } ToolboxFactory factory = factoryConfiguration.createFactory(); factory.configure(factoryConfiguration); toolContext = new ToolContext(); for (String scope : Scope.values()) { toolContext.addToolbox(factory.createToolbox(scope)); }
/** * This method attempts to do a deep copy of items which may change in this ToolContext. * The intent of this is to be able to take a snapshot of the state of the ToolContext * after it's initialised so we can run a tool multiple times with the same setup * while not having the state preserved between multiple runs. I didn't want * to call this clone() as it neither does a deep nor shallow copy. It does a mix * based on my best guess at what changes and what doesn't. */ public ToolContext makeCopy() { ToolContext newCopy = new ToolContext(); newCopy.javaModel = javaModel; newCopy.paramMap = new HashMap<>(paramMap); newCopy.packageName = packageName; newCopy.packageNameChanged = packageNameChanged; newCopy.namespacePackageMap = new HashMap<>(namespacePackageMap); newCopy.excludeNamespacePackageMap = new HashMap<>(excludeNamespacePackageMap); newCopy.jaxbBindingFiles = new ArrayList<>(jaxbBindingFiles); newCopy.excludePkgList = new ArrayList<>(excludePkgList); newCopy.excludeFileList = new ArrayList<>(excludeFileList); newCopy.errors = errors; return newCopy; } }
/** * This method attempts to do a deep copy of items which may change in this ToolContext. * The intent of this is to be able to take a snapshot of the state of the ToolContext * after it's initialised so we can run a tool multiple times with the same setup * while not having the state preserved between multiple runs. I didn't want * to call this clone() as it neither does a deep nor shallow copy. It does a mix * based on my best guess at what changes and what doesn't. */ public ToolContext makeCopy() { ToolContext newCopy = new ToolContext(); newCopy.javaModel = javaModel; newCopy.paramMap = new HashMap<>(paramMap); newCopy.packageName = packageName; newCopy.packageNameChanged = packageNameChanged; newCopy.namespacePackageMap = new HashMap<>(namespacePackageMap); newCopy.excludeNamespacePackageMap = new HashMap<>(excludeNamespacePackageMap); newCopy.jaxbBindingFiles = new ArrayList<>(jaxbBindingFiles); newCopy.excludePkgList = new ArrayList<>(excludePkgList); newCopy.excludeFileList = new ArrayList<>(excludeFileList); newCopy.errors = errors; return newCopy; } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { int i = Integer.parseInt(line); if (i == -1) { reader.close(); return; } String[] wargs = new String[i]; for (int x = 0; x < i; x++) { wargs[x] = reader.readLine(); } new WSDLToJava(wargs).run(new ToolContext()); line = reader.readLine(); } reader.close(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { int i = Integer.parseInt(line); if (i == -1) { reader.close(); return; } String[] wargs = new String[i]; for (int x = 0; x < i; x++) { wargs[x] = reader.readLine(); } new WADLToJava(wargs).run(new ToolContext()); line = reader.readLine(); } reader.close(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { int i = Integer.parseInt(line); if (i == -1) { reader.close(); return; } String[] wargs = new String[i]; for (int x = 0; x < i; x++) { wargs[x] = reader.readLine(); } new WSDLToJavaScript(wargs).run(new ToolContext()); line = reader.readLine(); } reader.close(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { int i = Integer.parseInt(line); if (i == -1) { reader.close(); return; } String[] wargs = new String[i]; for (int x = 0; x < i; x++) { wargs[x] = reader.readLine(); } new WSDLToJavaScript(wargs).run(new ToolContext()); line = reader.readLine(); } reader.close(); } }
public static void main(String[] args) throws Exception { File file = new File(args[0]); BufferedReader reader = new BufferedReader(new FileReader(file)); String line = reader.readLine(); while (line != null) { int i = Integer.parseInt(line); if (i == -1) { reader.close(); return; } String[] wargs = new String[i]; for (int x = 0; x < i; x++) { wargs[x] = reader.readLine(); } new WSDLToJava(wargs).run(new ToolContext()); line = reader.readLine(); } reader.close(); } }
public JavaModel execute() throws Exception { String args[] = new String[] { "-d", outpath.toString(), wsdlURL.toExternalForm(), }; ToolContext ctx = new ToolContext(); new WSDLToJava(args).run(ctx); JavaModel javaModel = ctx.getJavaModel(); return javaModel; } }
public static void main(String[] pargs) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); WADLToJava w2j = new WADLToJava(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WADLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WADLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } }
public static void main(String[] pargs) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); WSDLToJava w2j = new WSDLToJava(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } }
@Override public WebServiceRequest init(String wsdl) throws Exception { if (logger.isDebugEnabled()) logger.debug("wsdl to java:{}->{}", wsdl, SRC_DIR); CommandInterfaceUtils.commandCommonMain(); WSDLToJava w2j = new WSDLToJava(new String[]{"-client", "-d", SRC_DIR, "-compile", "-classdir", BIN_DIR, wsdl}); ToolContext toolContext = new ToolContext(); w2j.run(toolContext); // buildClass(); for (JavaInterface javaInterface : toolContext.getJavaModel().getInterfaces().values()) { interfaceMap.put(javaInterface.getName(), serviceClassLoader.loadClass(javaInterface.getFullClassName())); } for (JavaServiceClass serviceClass : toolContext.getJavaModel().getServiceClasses().values()) { serviceMap.put(serviceClass.getName(), serviceClassLoader.loadClass(serviceClass.getFullClassName())); } return this; }
public static void main(String[] pargs) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); WSDLToJava w2j = new WSDLToJava(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } }
public static void main(String[] pargs) { CommandInterfaceUtils.commandCommonMain(); WSDLToJavaScript w2j = new WSDLToJavaScript(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WSDLToJS Error : " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WSDLToJS Error : " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } if (w2j.isExitOnFinish()) { System.exit(0); } }
super.execute(exitOnFinish); if (!hasInfoOption()) { ToolContext env = new ToolContext(); env.setParameters(getParametersMap(getArrayKeys())); if (isVerboseOn()) {
super.execute(exitOnFinish); if (!hasInfoOption()) { ToolContext env = new ToolContext(); env.setParameters(getParametersMap(getArrayKeys()));
super.execute(exitOnFinish); if (!hasInfoOption()) { ToolContext env = new ToolContext(); env.setParameters(getParametersMap(getArrayKeys())); if (isVerboseOn()) {