package zutil.net.ws; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.Collection; import java.util.HashMap; import java.util.Set; import javax.wsdl.WSDLException; public class WebServiceDef { /** A map of methods in this Service **/ private HashMap methods; /** URL of the Service **/ //private String url; /** Namespace of the service **/ //private String namespace; /** Name of the web service **/ private String name; /** This is the WSInterface class **/ private Class intf; public WebServiceDef(Class intf) throws WSDLException{ this.intf = intf; methods = new HashMap(); name = intf.getSimpleName(); for(Method m : intf.getDeclaredMethods()){ // check for public methods if((m.getModifiers() & Modifier.PUBLIC) > 0 && !m.isAnnotationPresent(WSInterface.WSDisabled.class)){ WSMethodDef method = new WSMethodDef(m); methods.put(method.getName(), method); } } } /** * @return the class that defines this web service */ public Class getWSClass(){ return intf; } /** * @return the name of the Service (usually the class name of the WSInterface) */ public String getName(){ return name; } /** * @return a Set of all the method names */ public Set getMethodNames(){ return methods.keySet(); } /** * @return all the methods */ public Collection getMethods(){ return methods.values(); } }