changed folder name
This commit is contained in:
parent
4503531ec9
commit
80c6a52c69
73 changed files with 0 additions and 0 deletions
66
src/zutil/net/ws/WebServiceDef.java
Normal file
66
src/zutil/net/ws/WebServiceDef.java
Normal file
|
|
@ -0,0 +1,66 @@
|
|||
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<String,WSMethodDef> 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<? extends WSInterface> intf;
|
||||
|
||||
|
||||
public WebServiceDef(Class<? extends WSInterface> intf) throws WSDLException{
|
||||
this.intf = intf;
|
||||
methods = new HashMap<String,WSMethodDef>();
|
||||
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<? extends WSInterface> 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<String> getMethodNames(){
|
||||
return methods.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return all the methods
|
||||
*/
|
||||
public Collection<WSMethodDef> getMethods(){
|
||||
return methods.values();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue