antelder 2003/03/25 00:47:08
Modified: java/src/org/apache/wsif/providers/java
WSIFOperation_Java.java
Log:
No code changes, just format the getMethods method code
Revision Changes Path
1.40 +83 -84
xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java
Index: WSIFOperation_Java.java
===================================================================
RCS file:
/home/cvs/xml-axis-wsif/java/src/org/apache/wsif/providers/java/WSIFOperation_Java.java,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -r1.39 -r1.40
--- WSIFOperation_Java.java 25 Mar 2003 08:44:14 -0000 1.39
+++ WSIFOperation_Java.java 25 Mar 2003 08:47:08 -0000 1.40
@@ -432,111 +432,110 @@
* @param allMethods all the methods on the service's java class
* @return the subset of allMethods that match this WSDL operation
*/
- protected Method[] getMethods(Method[] allMethods)
- throws WSIFException {
+ protected Method[] getMethods(Method[] allMethods) throws WSIFException {
Trc.entry(this, allMethods);
ArrayList candidates = new ArrayList();
- if (!fieldIsConstructor) {
+ if (!fieldIsConstructor) {
- // Java methods start with a lower case but WSDL uses either case
- String bindingMethodName = fieldJavaOperationModel.getMethodName();
- String bindingMethodName2 = null;
- if (Character.isUpperCase(bindingMethodName.charAt(0))) {
- StringBuffer sb = new StringBuffer(bindingMethodName);
- sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
- bindingMethodName2 = sb.toString();
- }
+ // Java methods start with a lower case but WSDL uses either case
+ String bindingMethodName = fieldJavaOperationModel.getMethodName();
+ String bindingMethodName2 = null;
+ if (Character.isUpperCase(bindingMethodName.charAt(0))) {
+ StringBuffer sb = new StringBuffer(bindingMethodName);
+ sb.setCharAt(0, Character.toLowerCase(sb.charAt(0)));
+ bindingMethodName2 = sb.toString();
+ }
- Object[] args = getMethodArgumentClasses();
- Object retClass = getMethodReturnClass();
+ Object[] args = getMethodArgumentClasses();
+ Object retClass = getMethodReturnClass();
- Vector possibles = new Vector();
- for (int i = 0; i < allMethods.length; i++) {
- String methodName = allMethods[i].getName();
- if (!(methodName.equals(bindingMethodName)
- || methodName.equals(bindingMethodName2))) {
- continue;
+ Vector possibles = new Vector();
+ for (int i = 0; i < allMethods.length; i++) {
+ String methodName = allMethods[i].getName();
+ if (!(methodName.equals(bindingMethodName)
+ || methodName.equals(bindingMethodName2))) {
+ continue;
+ }
+ Class[] params = allMethods[i].getParameterTypes();
+ if (params.length != args.length)
+ continue;
+ Class retType = allMethods[i].getReturnType();
+
+ boolean tryAMap = false;
+ if (multiOutParts) {
+ Class mapClass = java.util.Map.class;
+ boolean found = false;
+ if (mapClass.getName().equals(retType.getName())) {
+ tryAMap = true;
+ } else if (mapClass.isAssignableFrom(retType)) {
+ tryAMap = true;
}
- Class[] params = allMethods[i].getParameterTypes();
- if (params.length != args.length)
- continue;
- Class retType = allMethods[i].getReturnType();
-
- boolean tryAMap = false;
- if (multiOutParts) {
- Class mapClass = java.util.Map.class;
+ }
+ if (!tryAMap) {
+ if (retClass != null && retClass instanceof Vector) {
+ Vector vec = (Vector) retClass;
boolean found = false;
- if (mapClass.getName().equals(retType.getName())) {
- tryAMap = true;
- } else if (mapClass.isAssignableFrom(retType)) {
- tryAMap = true;
- }
- }
- if (!tryAMap) {
- if (retClass != null && retClass instanceof Vector) {
- Vector vec = (Vector) retClass;
- boolean found = false;
- for (int p = 0; p < vec.size(); p++) {
- Class cl = (Class) vec.get(p);
- if (cl.getName().equals(retType.getName())) {
- found = true;
- break;
- } else if (cl.isAssignableFrom(retType)) {
- found = true;
- break;
- }
+ for (int p = 0; p < vec.size(); p++) {
+ Class cl = (Class) vec.get(p);
+ if (cl.getName().equals(retType.getName())) {
+ found = true;
+ break;
+ } else if (cl.isAssignableFrom(retType)) {
+ found = true;
+ break;
}
- if (!found)
+ }
+ if (!found)
+ continue;
+ } else {
+ if (retType != null && retClass != null) {
+ if (!(((Class) retClass)
+ .getName()
+ .equals(retType.getName()))
+ && !(((Class) retClass)
+ .isAssignableFrom(retType)))
continue;
- } else {
- if (retType != null && retClass != null) {
- if (!(((Class) retClass)
- .getName()
- .equals(retType.getName()))
- && !(((Class) retClass)
- .isAssignableFrom(retType)))
- continue;
- }
}
}
+ }
- boolean match = true;
- for (int j = 0; j < params.length; j++) {
- Object obj = args[j];
- if (obj instanceof Vector) {
- Vector vec = (Vector) obj;
- boolean found = false;
- for (int p = 0; p < vec.size(); p++) {
- Class cl = (Class) vec.get(p);
- if (cl.getName().equals(params[j].getName())) {
- found = true;
- break;
- } else if (params[j].isAssignableFrom(cl)) {
- found = true;
- break;
- }
- }
- if (!found) {
- match = false;
+ boolean match = true;
+ for (int j = 0; j < params.length; j++) {
+ Object obj = args[j];
+ if (obj instanceof Vector) {
+ Vector vec = (Vector) obj;
+ boolean found = false;
+ for (int p = 0; p < vec.size(); p++) {
+ Class cl = (Class) vec.get(p);
+ if (cl.getName().equals(params[j].getName())) {
+ found = true;
break;
- }
- } else {
- if (!(((Class) obj)
- .getName()
- .equals(params[j].getName()))
- && !(params[j].isAssignableFrom((Class) obj))) {
- match = false;
+ } else if (params[j].isAssignableFrom(cl)) {
+ found = true;
break;
}
}
+ if (!found) {
+ match = false;
+ break;
+ }
+ } else {
+ if (!(((Class) obj)
+ .getName()
+ .equals(params[j].getName()))
+ && !(params[j].isAssignableFrom((Class) obj))) {
+ match = false;
+ break;
+ }
}
- if (match) {
- candidates.add(allMethods[i]);
- }
+ }
+ if (match) {
+ candidates.add(allMethods[i]);
}
}
+ }
Method[] methods =
(Method[]) candidates.toArray(new Method[candidates.size()]);