159 */ |
159 */ |
160 public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException { |
160 public boolean buildModel(String endpoint, Listener listener) throws BadCommandLineException { |
161 final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); |
161 final ErrorReceiverFilter errReceiver = new ErrorReceiverFilter(listener); |
162 |
162 |
163 boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class); |
163 boolean bootCP = useBootClasspath(EndpointReference.class) || useBootClasspath(XmlSeeAlso.class); |
164 Collection<String> args = new ArrayList<String>(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) |
164 List<String> args = new ArrayList<String>(6 + (bootCP ? 1 : 0) + (options.nocompile ? 1 : 0) |
165 + (options.encoding != null ? 2 : 0)); |
165 + (options.encoding != null ? 2 : 0)); |
166 args.add("-d"); |
166 args.add("-d"); |
167 args.add(options.destDir.getAbsolutePath()); |
167 args.add(options.destDir.getAbsolutePath()); |
168 args.add("-classpath"); |
168 args.add("-classpath"); |
169 args.add(options.classpath); |
169 args.add(options.classpath); |
180 args.add(new StringBuilder() |
180 args.add(new StringBuilder() |
181 .append("-Xbootclasspath/p:") |
181 .append("-Xbootclasspath/p:") |
182 .append(JavaCompilerHelper.getJarFile(EndpointReference.class)) |
182 .append(JavaCompilerHelper.getJarFile(EndpointReference.class)) |
183 .append(File.pathSeparator) |
183 .append(File.pathSeparator) |
184 .append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString()); |
184 .append(JavaCompilerHelper.getJarFile(XmlSeeAlso.class)).toString()); |
|
185 } |
|
186 if (options.javacOptions != null) { |
|
187 args.addAll(options.getJavacOptions(args, listener)); |
185 } |
188 } |
186 |
189 |
187 JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create(); |
190 JavaCompiler compiler = ToolProvider.getSystemJavaCompiler();// compiler = JavacTool.create(); |
188 DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>(); |
191 DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<JavaFileObject>(); |
189 StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null); |
192 StandardJavaFileManager fileManager = compiler.getStandardFileManager(diagnostics, null, null); |
203 } |
206 } |
204 if (options.genWsdl) { |
207 if (options.genWsdl) { |
205 DatabindingConfig config = new DatabindingConfig(); |
208 DatabindingConfig config = new DatabindingConfig(); |
206 |
209 |
207 List<String> externalMetadataFileNames = options.externalMetadataFiles; |
210 List<String> externalMetadataFileNames = options.externalMetadataFiles; |
208 boolean disableSecureXmlProcessing = options.disableSecureXmlProcessing; |
211 boolean disableXmlSecurity = options.disableXmlSecurity; |
209 if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) { |
212 if (externalMetadataFileNames != null && externalMetadataFileNames.size() > 0) { |
210 config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableSecureXmlProcessing)); |
213 config.setMetadataReader(new ExternalMetadataReader(getExternalFiles(externalMetadataFileNames), null, null, true, disableXmlSecurity)); |
211 } |
214 } |
212 |
215 |
213 String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath; |
216 String tmpPath = options.destDir.getAbsolutePath() + File.pathSeparator + options.classpath; |
214 ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath), |
217 ClassLoader classLoader = new URLClassLoader(Options.pathToURLs(tmpPath), |
215 this.getClass().getClassLoader()); |
218 this.getClass().getClassLoader()); |
241 |
244 |
242 final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file. |
245 final File[] wsdlFileName = new File[1]; // used to capture the generated WSDL file. |
243 final Map<String, File> schemaFiles = new HashMap<String, File>(); |
246 final Map<String, File> schemaFiles = new HashMap<String, File>(); |
244 |
247 |
245 WSDLGenInfo wsdlGenInfo = new WSDLGenInfo(); |
248 WSDLGenInfo wsdlGenInfo = new WSDLGenInfo(); |
246 wsdlGenInfo.setSecureXmlProcessingDisabled(disableSecureXmlProcessing); |
249 wsdlGenInfo.setSecureXmlProcessingDisabled(disableXmlSecurity); |
247 |
250 |
248 wsdlGenInfo.setWsdlResolver( |
251 wsdlGenInfo.setWsdlResolver( |
249 new WSDLResolver() { |
252 new WSDLResolver() { |
250 private File toFile(String suggestedFilename) { |
253 private File toFile(String suggestedFilename) { |
251 return new File(options.nonclassDestDir, suggestedFilename); |
254 return new File(options.nonclassDestDir, suggestedFilename); |
402 options = this.options; |
405 options = this.options; |
403 if (options instanceof WsgenOptions) { |
406 if (options instanceof WsgenOptions) { |
404 System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", |
407 System.out.println(WscompileMessages.WSGEN_HELP("WSGEN", |
405 ((WsgenOptions)options).protocols, |
408 ((WsgenOptions)options).protocols, |
406 ((WsgenOptions)options).nonstdProtocols.keySet())); |
409 ((WsgenOptions)options).nonstdProtocols.keySet())); |
|
410 System.out.println(WscompileMessages.WSGEN_USAGE_EXTENSIONS()); |
407 System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); |
411 System.out.println(WscompileMessages.WSGEN_USAGE_EXAMPLES()); |
408 } |
412 } |
409 } |
413 } |
410 |
414 |
411 class Listener extends WsimportListener { |
415 class Listener extends WsimportListener { |