/**
   * Wraps a method as a JavaScript function.
   *
   * @param methodName the name of the method to wrap
   * @param clazz the class declaring the method
   * @param parameterTypes the types of the method's parameter
   * @throws NoSuchMethodException if the method is no found
   */
  MethodWrapper(final String methodName, final Class<?> clazz, final Class<?>[] parameterTypes)
      throws NoSuchMethodException {

    clazz_ = clazz;
    method_ = clazz.getMethod(methodName, parameterTypes);
    jsTypeTags_ = new int[parameterTypes.length];
    int i = 0;
    for (final Class<?> klass : parameterTypes) {
      jsTypeTags_[i++] = FunctionObject.getTypeTag(klass);
    }
  }