Search in sources :

Example 1 with AbstractGenerator

use of org.apache.cxf.tools.wsdlto.core.AbstractGenerator 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);
    }
}
Also used : JavaInterface(org.apache.cxf.tools.common.model.JavaInterface) JaxwsServerGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsServerGenerator) AbstractGenerator(org.apache.cxf.tools.wsdlto.core.AbstractGenerator) JaxwsImplGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsImplGenerator) JaxwsClientGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsClientGenerator) ServiceInfo(org.apache.cxf.service.model.ServiceInfo) EndpointInfo(org.apache.cxf.service.model.EndpointInfo) JaxwsSEIGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsSEIGenerator) JavaModel(org.apache.cxf.tools.common.model.JavaModel) ArrayList(java.util.ArrayList) List(java.util.List) AntGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.AntGenerator)

Example 2 with AbstractGenerator

use of org.apache.cxf.tools.wsdlto.core.AbstractGenerator 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);
    }
}
Also used : ServiceInfo(org.apache.cxf.service.model.ServiceInfo) SimpleSEIGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleSEIGenerator) SimpleImplGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleImplGenerator) SimpleClientGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleClientGenerator) JavaInterface(org.apache.cxf.tools.common.model.JavaInterface) SimpleServerGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleServerGenerator) JavaModel(org.apache.cxf.tools.common.model.JavaModel) AbstractGenerator(org.apache.cxf.tools.wsdlto.core.AbstractGenerator) ArrayList(java.util.ArrayList) List(java.util.List) AntGenerator(org.apache.cxf.tools.java2wsdl.processor.internal.AntGenerator)

Aggregations

ArrayList (java.util.ArrayList)2 List (java.util.List)2 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)2 JavaInterface (org.apache.cxf.tools.common.model.JavaInterface)2 JavaModel (org.apache.cxf.tools.common.model.JavaModel)2 AntGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.AntGenerator)2 AbstractGenerator (org.apache.cxf.tools.wsdlto.core.AbstractGenerator)2 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)1 JaxwsClientGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsClientGenerator)1 JaxwsImplGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsImplGenerator)1 JaxwsSEIGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsSEIGenerator)1 JaxwsServerGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.jaxws.generator.JaxwsServerGenerator)1 SimpleClientGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleClientGenerator)1 SimpleImplGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleImplGenerator)1 SimpleSEIGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleSEIGenerator)1 SimpleServerGenerator (org.apache.cxf.tools.java2wsdl.processor.internal.simple.generator.SimpleServerGenerator)1