summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/google/doclava/ClassInfo.java30
1 files changed, 28 insertions, 2 deletions
diff --git a/src/com/google/doclava/ClassInfo.java b/src/com/google/doclava/ClassInfo.java
index e8b1f89..add8270 100644
--- a/src/com/google/doclava/ClassInfo.java
+++ b/src/com/google/doclava/ClassInfo.java
@@ -1028,10 +1028,11 @@ public class ClassInfo extends DocInfo implements ContainerInfo, Comparable, Sco
data.setValue(base + ".deprecatedsince", getDeprecatedSince());
}
+ ArrayList<AnnotationInstanceInfo> showAnnos = getShowAnnotationsIncludeOuters();
AnnotationInstanceInfo.makeLinkListHDF(
data,
base + ".showAnnotations",
- showAnnotations().toArray(new AnnotationInstanceInfo[showAnnotations().size()]));
+ showAnnos.toArray(new AnnotationInstanceInfo[showAnnos.size()]));
setFederatedReferences(data, base);
}
@@ -1070,10 +1071,11 @@ public class ClassInfo extends DocInfo implements ContainerInfo, Comparable, Sco
data.setValue("class.abstract", "abstract");
}
+ ArrayList<AnnotationInstanceInfo> showAnnos = getShowAnnotationsIncludeOuters();
AnnotationInstanceInfo.makeLinkListHDF(
data,
"class.showAnnotations",
- showAnnotations().toArray(new AnnotationInstanceInfo[showAnnotations().size()]));
+ showAnnos.toArray(new AnnotationInstanceInfo[showAnnos.size()]));
// class info
String kind = kind();
@@ -1434,6 +1436,30 @@ public class ClassInfo extends DocInfo implements ContainerInfo, Comparable, Sco
return mShowAnnotations;
}
+ public ArrayList<AnnotationInstanceInfo> getShowAnnotationsIncludeOuters() {
+ ArrayList<AnnotationInstanceInfo> allAnnotations = new ArrayList<AnnotationInstanceInfo>();
+ ClassInfo cl = this;
+ while (cl != null) {
+ if (cl.showAnnotations() != null) {
+ // Don't allow duplicates into the merged list
+ for (AnnotationInstanceInfo newAii : cl.showAnnotations()) {
+ boolean addIt = true;
+ for (AnnotationInstanceInfo existingAii : allAnnotations) {
+ if (existingAii.type().name() == newAii.type().name()) {
+ addIt = false;
+ break;
+ }
+ }
+ if (addIt) {
+ allAnnotations.add(newAii);
+ }
+ }
+ }
+ cl = cl.containingClass();
+ }
+ return allAnnotations;
+ }
+
private MethodInfo matchMethod(ArrayList<MethodInfo> methods, String name, String[] params,
String[] dimensions, boolean varargs) {
for (MethodInfo method : methods) {