Object obj = objArg.evalObject(node, env);
if (obj == null ||
! (method.getDeclaringClass().isAssignableFrom(obj.getClass())))
throw new XPathException(L.l("Can't call method `{0}' on {1}.",
method.getName(), obj));
for (int i = 0; i < argArray.length; i++) {
Expr expr = (Expr) args.get(i);
switch (argTypes[i]) {
case J_BOOLEAN:
argArray[i] = new Boolean(expr.evalBoolean(node, env));
break;
case J_BYTE:
argArray[i] = new Byte((byte) expr.evalNumber(node, env));
break;
case J_SHORT:
argArray[i] = new Short((short) expr.evalNumber(node, env));
break;
case J_INT:
argArray[i] = new Integer((int) expr.evalNumber(node, env));
break;
case J_LONG:
argArray[i] = new Long((long) expr.evalNumber(node, env));
break;
case J_FLOAT:
argArray[i] = new Float((float) expr.evalNumber(node, env));
break;
case J_DOUBLE:
argArray[i] = new Double(expr.evalNumber(node, env));
break;
case J_STRING:
argArray[i] = expr.evalString(node, env);
break;
default:
argArray[i] = expr.evalObject(node, env);
break;
}
}
try {
return method.invoke(obj, argArray);
} catch (Exception e) {
throw new XPathException(e);
}
}