Exemplo n.º 1
0
  @Override
  protected void doWithMethodDocument(MethodDocument document, Method method) {
    ResourceMethod rm = method.getAnnotation(ResourceMethod.class);
    if (rm == null) {
      throw new IllegalArgumentException(
          "Can't generate document unless method is annotated with @ResourceMethod");
    }

    MethodParamProcessor mpp = new MethodParamProcessor();
    mpp.processAnnotations(method, document);

    // --- Process TGIRest annotations
    ResourceMethod resourceMethod = method.getAnnotation(ResourceMethod.class);
    if (resourceMethod != null) {
      document.setDescription(resourceMethod.description());

      document.setResponseErrors(getResponseErrors(resourceMethod));
      // Parse examples.
      document.setExampleDocuments(getExampleDocuments(resourceMethod));
    }
  }
Exemplo n.º 2
0
 private void buildDescription(MethodDocument document, JavaMethod javaMethod) {
   document.setDescription(javaMethod.getComment());
 }