}
try {
// get method
MethodInstance mi = Reflector.getMethodInstance(this,clazz,methodName,arguments);
// call static method if exist
if(Modifier.isStatic(mi.getMethod().getModifiers())) {
return mi.invoke(null);
}
if(arguments.length==0 && methodName.equalsIgnoreCase("getClass")){
return clazz;
}
// invoke constructor and call instance method
return mi.invoke(init());
}
catch(InvocationTargetException e) {
Throwable target = e.getTargetException();
if(target instanceof PageException) throw (PageException)target;
throw Caster.toPageException(e.getTargetException());