public static void callMethod(MethodOperation operation,MethodContext methodContext,List<MethodObject<?>> parameters,Class<?> methodClass,Object methodObject,String methodName,FlexibleMapAccessor<Object> retFieldFma) throws MiniLangRuntimeException {
  Object[] args=null;
  Class<?>[] parameterTypes=null;
  if (parameters != null) {
    args=new Object[parameters.size()];
    parameterTypes=new Class<?>[parameters.size()];
    int i=0;
    for (    MethodObject<?> methodObjectDef : parameters) {
      args[i]=methodObjectDef.getObject(methodContext);
      Class<?> typeClass=null;
      try {
        typeClass=methodObjectDef.getTypeClass(methodContext);
      }
 catch (      ClassNotFoundException e) {
        throw new MiniLangRuntimeException(e,operation);
      }
      parameterTypes[i]=typeClass;
      i++;
    }
  }
  try {
    Method method=methodClass.getMethod(methodName,parameterTypes);
    Object retValue=method.invoke(methodObject,args);
    if (!retFieldFma.isEmpty()) {
      retFieldFma.put(methodContext.getEnvMap(),retValue);
    }
  }
 catch (  Exception e) {
    throw new MiniLangRuntimeException(e,operation);
  }
}

public static void callMethod ( MethodOperation operation , MethodContext methodContext , List < MethodObject < ? > > parameters , Class < ? > methodClass , Object methodObject , String methodName , FlexibleMapAccessor < Object > retFieldFma ) throws MiniLangRuntimeException { Object [ ] args = null ; Class < ? > [ ] parameterTypes = null ; if ( parameters != null ) { args = new Object [ parameters . size ( ) ] ; parameterTypes = new Class < ? > [ parameters . size ( ) ] ; int i = 0 ; for ( MethodObject < ? > methodObjectDef : parameters ) { args [ i ] = methodObjectDef . getObject ( methodContext ) ; Class < ? > typeClass = null ; try { typeClass = methodObjectDef . getTypeClass ( methodContext ) ; } catch ( ClassNotFoundException e ) { throw new MiniLangRuntimeException ( e , operation ) ; } parameterTypes [ i ] = typeClass ; i ++ ; } } try { Method method = methodClass . getMethod ( methodName , parameterTypes ) ; Object retValue = method . invoke ( methodObject , args ) ; if ( ! retFieldFma . isEmpty ( ) ) { retFieldFma . put ( methodContext . getEnvMap ( ) , retValue ) ; } } catch ( Exception e ) { throw new MiniLangRuntimeException ( e , operation ) ; } }
calls an object method .
