org.jaxws.stub2html.service.WebServiceStubSetFactory Maven / Gradle / Ivy
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;
}
}