Ejemplo n.º 1
0
 public void executeEvent(MethodSpecifier eventMethodSpecifier, Scope scope) {
   Set<Method> beforeMethods = eventMethodSpecifier.getMethods(scope);
   for (Method beforeMethod : beforeMethods) {
     ReflectionUtil.invokeWithArgs(
         beforeMethod, addAndGetComponent(beforeMethod.getDeclaringClass()));
   }
 }
Ejemplo n.º 2
0
 Object invokeMethod(Object objectToInvoke) {
   Method method = getNaturalLanguageMethod().getMethod();
   List<ArgumentConverter> argumentConverters = naturalLanguageMethod.getArgumentConverters();
   Object[] args = new Object[matcher.groupCount()];
   for (int i = 0; i < matcher.groupCount(); i++) {
     String group = matcher.group(i + 1);
     args[i] = argumentConverters.get(i).convertArgument(group, naturalLanguageMethod, i);
   }
   return ReflectionUtil.invokeWithArgs(method, objectToInvoke, args);
 }