/**
   * Populate a Controller
   *
   * @param controller the controller to populate
   * @param type controller type
   * @param javadoc controller javadoc
   * @param methods controller methods
   * @return populated controller
   */
  public Controller build(
      Controller controller,
      final String type,
      final String javadoc,
      final Collection<Method> methods) {
    super.build(controller, type, type, javadoc);
    controller.setMethods(methods);

    return controller;
  }
  /**
   * Initialises the methods in this controller annotated with <code>@RequestMapping</code> in the
   * source class.
   *
   * @param classDoc the controller's Java documentation object.
   */
  private void initMethods(Controller controller, final ClassDoc classDoc) {

    ArrayList<Method> methods = new ArrayList<Method>();
    for (int i = 0; classDoc.methods(false) != null && i < classDoc.methods(false).length; i++) {
      if (isAnnotated(classDoc.methods(false)[i], RequestMapping.class)) {
        methods.add(new MethodBuilder().build(new Method(), classDoc.methods(false)[i]));
      }
    }

    controller.setMethods(methods);

    if (methods.size() == 0) {
      LOG.warn("No methods found with @RequestMapping tag");
    }
  }