@Override
public Set<FileInfo> generate(WSCodeGenModel cgModel, CGConfig config)
throws WscModuleException {
// freemarker datamodel
SimpleHash fmModel = this.getFreemarkerModel();
// container for target codes
Set<FileInfo> targetFileSet = new HashSet<FileInfo>();
info("Generating the Pico web serivce client classes...");
if (config.picoPrefix == null) {
warn("No prefix is provided, it's recommended to add prefix for Pico binding to avoid possible conflict");
}
String prefix = config.picoPrefix == null ? "" : config.picoPrefix;
prefixType(cgModel, prefix);
fmModel.put("group", config.picoServiceGroup);
// generate endpoint interface
for (SEIInfo interfaceInfo : cgModel.getServiceEndpointInterfaces()) {
fmModel.put("imports", this.getInterfaceImports(interfaceInfo));
fmModel.put("endpointInterface", interfaceInfo);
// special logic for ebay service demo, just a convenient for ebay service proxy generation
if (config.eBaySOAService) {
fmModel.put("eBaySOAService", config.eBaySOAService);
} else if (config.eBayShoppingAPI) {
fmModel.put("eBayShoppingAPI", config.eBayShoppingAPI);
} else if (config.eBayTradingAPI) {
fmModel.put("eBayTradingAPI", config.eBayTradingAPI);
}
String relativePath = ClassNameUtil.packageNameToPath(interfaceInfo.getPackageName());
relativePath += File.separator + "client";
FileInfo eiSoapIntf = this.generateFile(eiIntfSOAPTemplate, fmModel, interfaceInfo.getName() + "_SOAPClient", "h", relativePath);
targetFileSet.add(eiSoapIntf);