use of com.sun.tools.ws.api.TJavaGeneratorExtension in project metro-jax-ws by eclipse-ee4j.
the class SeiGenerator method init.
public void init(Model model, WsimportOptions options, ErrorReceiver receiver, TJavaGeneratorExtension... extensions) {
init(model, options, receiver);
extensionHandlers = new ArrayList<>();
// 2.2 Spec requires generation of @Action when wsam:Action is explicitly stated in wsdl
if (options.target.isLaterThan(Options.Target.V2_2)) {
register(new W3CAddressingJavaGeneratorExtension());
}
for (TJavaGeneratorExtension j : extensions) {
register(j);
}
this.extension = new JavaGeneratorExtensionFacade(extensionHandlers.toArray(new TJavaGeneratorExtension[0]));
}
use of com.sun.tools.ws.api.TJavaGeneratorExtension in project metro-jax-ws by eclipse-ee4j.
the class WsimportTool method generateCode.
protected boolean generateCode(Listener listener, Receiver receiver, Model wsdlModel, boolean generateService) throws IOException {
// generated code
if (!options.quiet)
listener.message(WscompileMessages.WSIMPORT_GENERATING_CODE());
TJavaGeneratorExtension[] genExtn = ServiceFinder.find(TJavaGeneratorExtension.class, ServiceLoader.load(TJavaGeneratorExtension.class)).toArray();
CustomExceptionGenerator.generate(wsdlModel, options, receiver);
SeiGenerator.generate(wsdlModel, options, receiver, genExtn);
if (receiver.hadError()) {
throw new AbortException();
}
if (generateService) {
ServiceGenerator.generate(wsdlModel, options, receiver);
}
for (GeneratorBase g : ServiceFinder.find(GeneratorBase.class, ServiceLoader.load(GeneratorBase.class))) {
g.init(wsdlModel, options, receiver);
g.doGeneration();
}
List<String> implFiles = null;
if (options.isGenerateJWS) {
implFiles = JwsImplGenerator.generate(wsdlModel, options, receiver);
}
for (Plugin plugin : options.activePlugins) {
try {
plugin.run(wsdlModel, options, receiver);
} catch (SAXException sex) {
// fatal error. error should have been reported
return false;
}
}
if (options.getModuleName() != null) {
options.getCodeModel()._prepareModuleInfo(options.getModuleName(), JAXWS_MODULE);
}
CodeWriter cw;
if (options.filer != null) {
cw = new FilerCodeWriter(options);
} else {
cw = new WSCodeWriter(options.sourceDir, options);
}
if (options.verbose)
cw = new ProgressCodeWriter(cw, out);
options.getCodeModel().build(cw);
if (options.isGenerateJWS) {
// move Impl files to implDestDir
return JwsImplGenerator.moveToImplDestDir(implFiles, options, receiver);
}
return true;
}
Aggregations