private void annotationTypes(RamlDocumentBuilder builder, RamlApi modelApi) throws IOException { for (RamlSupportedAnnotation ramlSupportedAnnotation : modelApi.getSupportedAnnotation()) { AnnotationTypeBuilder annotationTypeBuilder = AnnotationTypeBuilder.annotationType(ramlSupportedAnnotation.getAnnotation().getSimpleName()); Class<? extends Annotation> javaAnnotation = ramlSupportedAnnotation.getAnnotation(); if (javaAnnotation.getDeclaredMethods().length > 0) { for (Method method : javaAnnotation.getDeclaredMethods()) { if (method.getReturnType().isArray()) { annotationTypeBuilder.withProperty(property(method.getName(), calculateRamlType(method.getReturnType() .getComponentType()) + "[]")); } else { annotationTypeBuilder.withProperty(property(method.getName(), calculateRamlType(method.getReturnType()) )); } } builder.withAnnotationTypes(annotationTypeBuilder); } } }
if (description.isPresent() && !description.get().isEmpty()) { methodBuilder.with(property("description", description.get()));
node.addChild(property("description", description).buildNode());