All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jaxws.stub2html.service.WebServiceStubSetFactory Maven / Gradle / Ivy

There is a newer version: 4.2.2
Show newest version
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;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy