private static boolean isPublicAPI(Doc doc) {
if (doc.tags(PRIVATE_TAG).length > 0)
return false;
if (doc instanceof ProgramElementDoc) {
ProgramElementDoc peDoc = (ProgramElementDoc) doc;
if (peDoc.containingClass() != null && peDoc.containingClass().tags(PUBLIC_TAG).length > 0)
return true;
if (peDoc.containingPackage().tags(PUBLIC_TAG).length > 0)
return true;
}
return doc.tags(PUBLIC_TAG).length > 0;