Generate documentation based on annotations attached to classes and methods
Allow users to pass in a text file of the format:
annotationname:Documentation String
annotation2:More Documentation
that will get inserted into the docs when a class or method has
that annotation.
Bug: 19931569
Change-Id: Ic2334dd2fcba638526cf2d67e25e27cf8e39b6fe
diff --git a/src/com/google/doclava/MethodInfo.java b/src/com/google/doclava/MethodInfo.java
index eb360cd..f1659f3 100644
--- a/src/com/google/doclava/MethodInfo.java
+++ b/src/com/google/doclava/MethodInfo.java
@@ -592,6 +592,18 @@
TypeInfo.makeHDF(data, base + ".generic.typeArguments", mTypeParameters, false);
}
+ int numAnnotationDocumentation = 0;
+ for (AnnotationInstanceInfo aii : annotations()) {
+ String annotationDocumentation = Doclava.getDocumentationStringForAnnotation(
+ aii.type().qualifiedName());
+ if (annotationDocumentation != null) {
+ data.setValue(base + ".annotationdocumentation." + numAnnotationDocumentation + ".text",
+ annotationDocumentation);
+ numAnnotationDocumentation++;
+ }
+ }
+
+
AnnotationInstanceInfo.makeLinkListHDF(
data,
base + ".showAnnotations",