private void gatherDocumentationGroupFacets(Declaration decl, Set<Facet> facets) {
if (decl != null) {
DocumentationGroup documentationGroup = decl.getAnnotation(DocumentationGroup.class);
if (documentationGroup != null) {
for (String name : documentationGroup.value()) {
facets.add(new Facet(DocumentationGroup.class.getName(), name, new JavaDoc(decl.getDocComment()).toString()));
}
}
else if (decl instanceof TypeDeclaration) {
PackageDeclaration pkg = ((TypeDeclaration)decl).getPackage();
if (pkg != null) {
documentationGroup = pkg.getAnnotation(DocumentationGroup.class);
if (documentationGroup != null) {
for (String name : documentationGroup.value()) {
facets.add(new Facet(DocumentationGroup.class.getName(), name, new JavaDoc(pkg.getDocComment()).toString()));
}
}
}
}
}