comment.addLine("Invoker for method " + pMethod.getName() + "(" + sb + ")");
comment.addLine("in class " + pMethod.getJavaSource().getQName() + ".");
js.setStatic(true);
js.addImplements(pInvoker);
JavaMethod jm = js.newJavaMethod("invoke", Object.class, JavaSource.PUBLIC);
Parameter param = jm.addParam(Vector.class, "params");
JavaQName[] classes = pMethod.getExceptions();
for (int i = 0; i < classes.length; i++) {
jm.addThrows(classes[i]);
}
List args = new ArrayList();
for (int i = 0; i < params.length; i++) {
if (i > 0) {
args.add(", ");
}
Parameter p = params[i];
args.add(getResultValue(jm, p.getType(), new Object[]{param, ".elementAt(" + i + ")"}));
}
Object o = new Object[]{"new ", pMethod.getJavaSource().getQName(), "().",
pMethod.getName(), "(", args, ")"};
if (JavaQNameImpl.VOID.equals(pMethod.getType())) {
jm.addLine(o, ";");