src/main/java/org/ucmtwine/proxy/ScriptProxy.java
private void generateDefinitions() {
    functionParameterTypes = new ArrayList<Class<?>[]>();
    functionMethodNames = new ArrayList<String>();
    variableParameterTypes = new ArrayList<Class<?>[]>();
    variableMethodNames = new ArrayList<String>();

    List<String> functionNames = new ArrayList<String>();
    List<ParameterMarshaller> functionParams = new ArrayList<ParameterMarshaller>();
    List<Integer> functionReturnTypes = new ArrayList<Integer>();

    List<String> variableNames = new ArrayList<String>();
    List<Integer> variableReturnTypes = new ArrayList<Integer>();

    Method ms[] = m_class.getDeclaredMethods();

    functionMethods = new Method[ms.length];

    Map<String, Method> methods = new TreeMap<String, Method>();

    for (Method m : ms) {
      methods.put(m.getName(), m);
    }

    int functionCounter = 0;

    for (String methodName : methods.keySet()) {
      Method m = methods.get(methodName);
      IdocFunction functionInfo = m.getAnnotation(IdocFunction.class);

      if (functionInfo != null) {
        if (functionInfo.name().equals("")) {
          functionNames.add(m.getName());
        } else {
          functionNames.add(functionInfo.name());
        }
        functionMethodNames.add(m.getName());
        functionMethods[functionCounter] = m;
        functionParams.add(new ParameterMarshaller(m));
        functionReturnTypes.add(getFunctionReturnType(m));
        functionParameterTypes.add(m.getParameterTypes());
        functionCounter++;

      } else {
        IdocVariable varInfo = m.getAnnotation(IdocVariable.class);

        if (varInfo != null) {
          if (varInfo.name().equals("")) {
            variableNames.add(m.getName());
          } else {
            variableNames.add(varInfo.name());
          }
          variableMethodNames.add(m.getName());
          variableReturnTypes.add(getVariableReturnType(m));
          variableParameterTypes.add(m.getParameterTypes());
        }
      }
    }

    writeVariableTables(variableNames, variableReturnTypes);
    writeFunctionTables(functionNames, functionParams, functionReturnTypes);
  }
private void generateDefinitions() {
    functionParameterTypes = new ArrayList<Class<?>[]>();
    functionMethodNames = new ArrayList<String>();
    variableParameterTypes = new ArrayList<Class<?>[]>();
    variableMethodNames = new ArrayList<String>();

    List<String> functionNames = new ArrayList<String>();
    List<ParameterMarshaller> functionParams = new ArrayList<ParameterMarshaller>();
    List<Integer> functionReturnTypes = new ArrayList<Integer>();

    List<String> variableNames = new ArrayList<String>();
    List<Integer> variableReturnTypes = new ArrayList<Integer>();

    Method ms[] = m_class.getDeclaredMethods();

    functionMethods = new Method[ms.length];

    Map<String, Method> methods = new TreeMap<String, Method>();

    for (Method m : ms) {
      methods.put(m.getName(), m);
    }

    int functionCounter = 0;

    for (String methodName : methods.keySet()) {
      Method m = methods.get(methodName);
      IdocFunction functionInfo = m.getAnnotation(IdocFunction.class);

      if (functionInfo != null) {
        if (functionInfo.name().equals("")) {
          functionNames.add(m.getName());
        } else {
          functionNames.add(functionInfo.name());
        }
        functionMethodNames.add(m.getName());
        functionMethods[functionCounter] = m;
        functionParams.add(new ParameterMarshaller(m));
        functionReturnTypes.add(getFunctionReturnType(m));
        functionParameterTypes.add(m.getParameterTypes());
        functionCounter++;

      } else {
        IdocVariable varInfo = m.getAnnotation(IdocVariable.class);

        if (varInfo != null) {
          if (varInfo.name().equals("")) {
            variableNames.add(m.getName());
          } else {
            variableNames.add(varInfo.name());
          }
          variableMethodNames.add(m.getName());
          variableReturnTypes.add(getVariableReturnType(m));
          variableParameterTypes.add(m.getParameterTypes());
        }
      }
    }

    writeVariableTables(variableNames, variableReturnTypes);
    writeFunctionTables(functionNames, functionParams, functionReturnTypes);
  }
Configuration data for functions. This list must align with the
"m_functionTable" list. In order the values are "id number",
"Number of arguments", "First argument type", "Second argument type",
"Return Type". Return type has the following possible values: 0 generic
object (such as strings) 1 boolean 2 integer 3 double. The value "-1" means
the value is unspecified.

@param klass
The annotated class