public Object invoke (Object target, Object[] args) throws IllegalAccessException, InvocationTargetException { try { return methodAccess.invoke(target, methodAccessIndex, args); } catch (Exception ex) { throw new InvocationTargetException(ex); } } }
@Override @SuppressWarnings("unchecked") public U getValue(T target) { if (getterIndex != NO_METHOD) { return (U) methodAccess.invoke(target, getterIndex); } else { return (U) fieldAccess.get(target, fieldIndex); } }
@Override public void setValue(T target, U value) { if (setterIndex != NO_METHOD) { methodAccess.invoke(target, setterIndex, value); } else { fieldAccess.set(target, fieldIndex, value); } } }
@Override public void invoke(EntityRef entity, Event event) { try { Object[] params = new Object[2 + componentParams.size()]; params[0] = event; params[1] = entity; for (int i = 0; i < componentParams.size(); ++i) { params[i + 2] = entity.getComponent(componentParams.get(i)); } if (!activity.isEmpty()) { PerformanceMonitor.startActivity(activity); } try { methodAccess.invoke(handler, methodIndex, params); } finally { if (!activity.isEmpty()) { PerformanceMonitor.endActivity(); } } } catch (Exception ex) { logger.error("Failed to invoke event", ex); } }
@Override public void invoke(EntityRef entity, Event event) { try { Object[] params = new Object[2 + componentParams.size()]; params[0] = event; params[1] = entity; for (int i = 0; i < componentParams.size(); ++i) { params[i + 2] = entity.getComponent(componentParams.get(i)); } if (!activity.isEmpty()) { PerformanceMonitor.startActivity(activity); } try { methodAccess.invoke(handler, methodIndex, params); } finally { if (!activity.isEmpty()) { PerformanceMonitor.endActivity(); } } } catch (Exception ex) { logger.error("Failed to invoke event", ex); } }
/** Invokes the first method with the specified name and the specified number of arguments. */ public Object invoke (Object object, String methodName, Object... args) { return invoke(object, getIndex(methodName, args == null ? 0 : args.length), args); }
/** Invokes the method with the specified name and the specified param types. */ public Object invoke (Object object, String methodName, Class[] paramTypes, Object... args) { return invoke(object, getIndex(methodName, paramTypes), args); }
private Object invoke(Object commander, Object[] params) { Object result; if (null != methodAccess) { result = methodAccess.invoke(commander, commandIndex, params); } else { result = $.invokeStatic(method, params); } return result; }
private Object invoke(Object commander, Object[] params) { Object result; if (null != methodAccess) { result = methodAccess.invoke(commander, commandIndex, params); } else { result = $.invokeStatic(method, params); } return result; }
public void add(Object target, Object value) { try { methodAccess.invoke(target, adderMethodIndex, value); } catch (Throwable t) { throw new SvensonRuntimeException("Error adding value " + value + " to target " + target + " using " + adderMethodIndex, t); } }
/** * Invokes the first method with the specified name. */ public Object invoke (Object object, String methodName, Object... args) { return invoke(object, getIndex(methodName), args); }
/** Invokes the method with the specified name and the specified param types. */ public Object invoke (Object object, String methodName, Class[] paramTypes, Object... args) { return invoke(object, getIndex(methodName, paramTypes), args); }
/** Invokes the first method with the specified name and the specified number of arguments. */ public Object invoke (Object object, String methodName, Object... args) { return invoke(object, getIndex(methodName, args == null ? 0 : args.length), args); }
/** Invokes the first method with the specified name and the specified number of arguments. */ public Object invoke (Object object, String methodName, Object... args) { return invoke(object, getIndex(methodName, args == null ? 0 : args.length), args); }
/** Invokes the method with the specified name and the specified param types. */ public Object invoke (Object object, String methodName, Class[] paramTypes, Object... args) { return invoke(object, getIndex(methodName, paramTypes), args); }
private Object invoke(Object jobClassInstance, JobContext ctx) { Object[] params = params(jobClassInstance, ctx); return null == methodAccess ? $.invokeStatic(method, params) : methodAccess.invoke(jobClassInstance, methodIndex, params); }
Object getValue(App app) { Object[] params = params(); if (null != methodAccess) { return methodAccess.invoke(app.getInstance(cls), methodIndex, params); } else { return $.invokeStatic(method, params); } }
Object getValue(App app) { Object[] params = params(); if (null != methodAccess) { return methodAccess.invoke(app.getInstance(cls), methodIndex, params); } else { return $.invokeStatic(method, params); } }
private Object invoke(ActionContext context, Object controller, Object[] params) { Object retVal; retVal = null == methodAccess ? $.invokeStatic(method, params) : methodAccess.invoke(controller, handlerIndex, params); if (returnString && context.acceptJson()) { retVal = null == retVal ? null : ensureValidJson(S.string(retVal)); } context.calcResultHashForEtag(retVal); return retVal; }
private Object invoke(ActionContext context, Object controller, Object[] params) { Object retVal; retVal = null == methodAccess ? $.invokeStatic(method, params) : methodAccess.invoke(controller, handlerIndex, params); if (returnString && context.acceptJson()) { retVal = null == retVal ? null : ensureValidJson(S.string(retVal)); } context.calcResultHashForEtag(retVal); return retVal; }