org.jaxws.stub2html.service.WebServiceStubSetFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of wsdl2html Show documentation
Show all versions of wsdl2html Show documentation
A java tool to convert wsdl xml to readable doc
package org.jaxws.stub2html.service;
import static org.jaxws.stub2html.service.WebMethodStubSetFactory.createWebMethodStubSet;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;
import javax.jws.WebMethod;
import org.jaxws.stub2html.model.WebServiceStubSet;
/**
*
* @author chenjianjx
*
*/
public class WebServiceStubSetFactory {
public static WebServiceStubSet createWebServiceStubSet(Class> webServiceClass) {
List methods = getWebMethods(webServiceClass);
WebServiceStubSet serviceStubs = new WebServiceStubSet();
serviceStubs.setWebServiceClass(webServiceClass);
for (Method method : methods) {
serviceStubs.addMethodStub(createWebMethodStubSet(method));
}
return serviceStubs;
}
private static List getWebMethods(Class> webServiceClass) {
List webMethods = new ArrayList();
for (Method method : webServiceClass.getMethods()) {
if (method.isAnnotationPresent(WebMethod.class)) {
webMethods.add(method);
}
}
return webMethods;
}
}