Exemplo n.º 1
0
  @Override
  protected void doWithResourceDocument(ResourceDocument document, Class<?> classOfResource) {
    // Check if the class is present in the builder.
    if (javaDocBuilder.getClassByName(classOfResource.getName()) == null)
      throw new IllegalArgumentException(
          "Class " + classOfResource + " was not found within the specified source files.");

    JavaClass javaClass = javaDocBuilder.getClassByName(classOfResource.getName());

    document.setDescription(javaClass.getComment());
    document.setTitle(titleOrNull(javaClass));
  }
Exemplo n.º 2
0
  @Override
  protected void doWithResourceDocument(ResourceDocument document, Class<?> classOfResource) {
    LOG.info("Generating ResourceDocument for {}", classOfResource);
    if (!classOfResource.isAnnotationPresent(ResourceDoc.class)) {
      throw new RuntimeException(
          "Cannot generate documentation for a resource class "
              + "that is not annotated with @ResoureceDoc");
    }

    // --- Process TGIRest annotations
    ResourceDoc rd = (ResourceDoc) classOfResource.getAnnotation(ResourceDoc.class);
    document.setDescription(rd.description());
    document.setTitle(rd.title());
  }
Exemplo n.º 3
0
  private JavaMethod getJavaMethod(Method method) {
    Class<?> declaringClass = method.getDeclaringClass();

    final JavaClass doc = javaDocBuilder.getClassByName(declaringClass.getName());
    return doc.getMethodBySignature(method.getName(), convertMethodParameterTypes(method));
  }