859 * Return true if the given Doc is deprecated. |
859 * Return true if the given Doc is deprecated. |
860 * |
860 * |
861 * @param doc the Doc to check. |
861 * @param doc the Doc to check. |
862 * @return true if the given Doc is deprecated. |
862 * @return true if the given Doc is deprecated. |
863 */ |
863 */ |
864 public static boolean isDeprecated(ProgramElementDoc doc) { |
864 public static boolean isDeprecated(Doc doc) { |
865 if (doc.tags("deprecated").length > 0) { |
865 if (doc.tags("deprecated").length > 0) { |
866 return true; |
866 return true; |
867 } |
867 } |
868 AnnotationDesc[] annotationDescList = doc.annotations(); |
868 AnnotationDesc[] annotationDescList; |
|
869 if (doc instanceof PackageDoc) |
|
870 annotationDescList = ((PackageDoc)doc).annotations(); |
|
871 else |
|
872 annotationDescList = ((ProgramElementDoc)doc).annotations(); |
869 for (int i = 0; i < annotationDescList.length; i++) { |
873 for (int i = 0; i < annotationDescList.length; i++) { |
870 if (annotationDescList[i].annotationType().qualifiedName().equals( |
874 if (annotationDescList[i].annotationType().qualifiedName().equals( |
871 java.lang.Deprecated.class.getName())){ |
875 java.lang.Deprecated.class.getName())){ |
872 return true; |
876 return true; |
873 } |
877 } |