HashMap uniqueMethods = new HashMap();
XmlSchemaComplexType methodSchemaType;
XmlSchemaSequence sequence = null;
for (int i = 0; i < methods.length; i++) {
JMethod jMethod = methods[i];
String methodName = methods[i].getSimpleName();
// no need to think abt this method , since that is system
// config method
if (excludeMethods.contains(jMethod.getSimpleName())) {
continue;
}
if (uniqueMethods.get(jMethod.getSimpleName()) != null) {
throw new Exception(" Sorry we don't support methods overloading !!!! ");
}
if (!jMethod.isPublic()) {
// no need to generate Schema for non public methods
continue;
}
uniqueMethods.put(jMethod.getSimpleName(), jMethod);
// create the schema type for the method wrapper
uniqueMethods.put(jMethod.getSimpleName(), jMethod);
JParameter[] paras = jMethod.getParameters();
String parameterNames[] = null;
// better to handle void types too
parameterNames = methodTable.getParameterNames(methodName);
sequence = new XmlSchemaSequence();
methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName());
methodSchemaType.setParticle(sequence);
for (int j = 0; j < paras.length; j++) {
JParameter methodParameter = paras[j];
JClass paraType = methodParameter.getType();
generateSchemaForType(sequence, paraType, (parameterNames != null && parameterNames[j] != null)
? parameterNames[j] : methodParameter.getSimpleName());
}
// for its return type
JClass returnType = jMethod.getReturnType();
// better to handle void types too
methodSchemaType = createSchemaTypeForMethodPart(jMethod.getSimpleName() + RESPONSE);
sequence = new XmlSchemaSequence();
methodSchemaType.setParticle(sequence);
generateSchemaForType(sequence, returnType, "return");
}
} else {