use of org.apache.cxf.tools.common.model.JavaInterface in project cxf by apache.
the class InterfaceMapperTest method testMap.
@Test
public void testMap() throws Exception {
InterfaceInfo interfaceInfo = new InterfaceInfo(new ServiceInfo(), new QName("http://apache.org/hello_world_soap_http", "interfaceTest"));
ToolContext context = new ToolContext();
context.put(ToolConstants.CFG_WSDLURL, "http://localhost/?wsdl");
JavaInterface intf = new InterfaceMapper(context).map(interfaceInfo);
assertNotNull(intf);
assertEquals("interfaceTest", intf.getWebServiceName());
assertEquals("InterfaceTest", intf.getName());
assertEquals("http://apache.org/hello_world_soap_http", intf.getNamespace());
assertEquals("org.apache.hello_world_soap_http", intf.getPackageName());
assertEquals("http://localhost/?wsdl", intf.getLocation());
}
use of org.apache.cxf.tools.common.model.JavaInterface in project cxf by apache.
the class JAXWSFrontEndProcessor method process.
@SuppressWarnings("unchecked")
public void process() throws ToolException {
checkJaxwsClass();
List<ServiceInfo> services = (List<ServiceInfo>) context.get(ToolConstants.SERVICE_LIST);
ServiceInfo serviceInfo = services.get(0);
JavaInterface jinf = JavaFirstUtil.serviceInfo2JavaInf(serviceInfo);
String className = (String) context.get(ToolConstants.IMPL_CLASS);
if (className != null && className.equals(jinf.getFullClassName())) {
jinf.setName(jinf.getName() + SEI_SUFFIX);
}
JavaModel jm = new JavaModel();
jm.addInterface("inf", jinf);
jinf.setJavaModel(jm);
context.put(JavaModel.class, jm);
context.put(ToolConstants.SERVICE_NAME, serviceInfo.getName());
EndpointInfo endpointInfo = serviceInfo.getEndpoints().iterator().next();
context.put(ToolConstants.PORT_NAME, endpointInfo.getName());
generators.add(new JaxwsSEIGenerator());
generators.add(new JaxwsImplGenerator());
generators.add(new JaxwsServerGenerator());
generators.add(new JaxwsClientGenerator());
generators.add(new AntGenerator());
for (AbstractGenerator generator : generators) {
generator.generate(context);
}
}
use of org.apache.cxf.tools.common.model.JavaInterface in project cxf by apache.
the class JaxwsClientGenerator method generate.
public void generate(ToolContext penv) throws ToolException {
this.env = penv;
JavaModel javaModel = env.get(JavaModel.class);
if (passthrough()) {
return;
}
Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
QName service = (QName) env.get(ToolConstants.SERVICE_NAME);
QName port = (QName) env.get(ToolConstants.PORT_NAME);
for (JavaInterface intf : interfaces.values()) {
clearAttributes();
setAttributes("intf", intf);
setAttributes("service", service);
setAttributes("port", port);
setAttributes("address", penv.get(ToolConstants.CFG_ADDRESS));
setAttributes("seiClass", env.get(ToolConstants.SEI_CLASS));
setCommonAttributes();
doWrite(CLIENT_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Client"));
}
}
use of org.apache.cxf.tools.common.model.JavaInterface in project cxf by apache.
the class JaxwsServerGenerator method generate.
public void generate(ToolContext penv) throws ToolException {
this.env = penv;
JavaModel javaModel = env.get(JavaModel.class);
if (passthrough()) {
return;
}
Map<String, JavaInterface> interfaces = javaModel.getInterfaces();
for (JavaInterface intf : interfaces.values()) {
clearAttributes();
setAttributes("intf", intf);
setAttributes("address", penv.get(ToolConstants.CFG_ADDRESS));
setAttributes("implClass", env.get(ToolConstants.IMPL_CLASS));
setCommonAttributes();
doWrite(SERVER_TEMPLATE, parseOutputName(intf.getPackageName(), intf.getName() + "Server"));
}
}
use of org.apache.cxf.tools.common.model.JavaInterface in project cxf by apache.
the class SimpleFrontEndProcessor method process.
@SuppressWarnings("unchecked")
public void process() throws ToolException {
List<ServiceInfo> services = (List<ServiceInfo>) context.get(ToolConstants.SERVICE_LIST);
ServiceInfo serviceInfo = services.get(0);
JavaInterface jinf = JavaFirstUtil.serviceInfo2JavaInf(serviceInfo);
JavaModel jm = new JavaModel();
jm.addInterface("inf", jinf);
jinf.setJavaModel(jm);
context.put(JavaModel.class, jm);
generators.add(new SimpleSEIGenerator());
generators.add(new SimpleImplGenerator());
generators.add(new SimpleServerGenerator());
generators.add(new SimpleClientGenerator());
generators.add(new AntGenerator());
for (AbstractGenerator generator : generators) {
generator.generate(context);
}
}
Aggregations