use of org.apache.cxf.tools.wsdlto.frontend.jaxws.processor.internal.ServiceProcessor in project cxf by apache.
the class WSDLToJavaProcessor method wsdlDefinitionToJavaModel.
private JavaModel wsdlDefinitionToJavaModel(ServiceInfo serviceInfo) throws ToolException {
JavaModel javaModel = null;
Map<QName, JavaModel> map = CastUtils.cast((Map<?, ?>) context.get(MODEL_MAP));
if (map == null) {
map = new LinkedHashMap<QName, JavaModel>();
context.put(MODEL_MAP, map);
}
if (map.containsKey(serviceInfo.getName())) {
javaModel = map.get(serviceInfo.getName());
} else {
javaModel = new JavaModel();
map.put(serviceInfo.getName(), javaModel);
}
context.put(JavaModel.class, javaModel);
List<JavaInterface> interfaces = new ArrayList<>();
interfaces.addAll(javaModel.getInterfaces().values());
PortTypeProcessor portTypeProcessor = new PortTypeProcessor(context);
portTypeProcessor.process(serviceInfo);
ServiceProcessor serviceProcessor = new ServiceProcessor(context);
serviceProcessor.process(serviceInfo);
for (JavaInterface intf : javaModel.getInterfaces().values()) {
if (!interfaces.contains(intf)) {
intf.annotate(new WebServiceAnnotator());
intf.annotate(new XmlSeeAlsoAnnotator(context.get(ClassCollector.class)));
intf.annotate(new BindingAnnotator());
}
}
return javaModel;
}
Aggregations