/**
  * Return true if the given Doc should be included in the serialized form.
  *
  * @param doc the Doc object to check for serializability.
  */
 private static boolean serialDocInclude(Doc doc) {
   if (doc.isEnum()) {
     return false;
   }
   Tag[] serial = doc.tags("serial");
   if (serial.length > 0) {
     String serialtext = StringUtils.toLowerCase(serial[0].text());
     if (serialtext.indexOf("exclude") >= 0) {
       return false;
     } else if (serialtext.indexOf("include") >= 0) {
       return true;
     }
   }
   return true;
 }
Beispiel #2
0
 /**
  * Return true if the given Doc is deprecated.
  *
  * @param doc the Doc to check.
  * @return true if the given Doc is deprecated.
  */
 public static boolean isDeprecated(Doc doc) {
   if (doc.tags("deprecated").length > 0) {
     return true;
   }
   AnnotationDesc[] annotationDescList;
   if (doc instanceof PackageDoc) annotationDescList = ((PackageDoc) doc).annotations();
   else annotationDescList = ((ProgramElementDoc) doc).annotations();
   for (int i = 0; i < annotationDescList.length; i++) {
     if (annotationDescList[i]
         .annotationType()
         .qualifiedName()
         .equals(java.lang.Deprecated.class.getName())) {
       return true;
     }
   }
   return false;
 }
 /**
  * Given a <code>Doc</code>, return an anchor name for it.
  *
  * @param d the <code>Doc</code> to check.
  * @return the name of the anchor.
  */
 public static String getAnchorName(Doc d) {
   return "line." + d.position().line();
 }
 /**
  * Return true if the given Doc should be included in the serialized form.
  *
  * @param doc the Doc object to check for serializability.
  */
 public static boolean serialInclude(Doc doc) {
   if (doc == null) {
     return false;
   }
   return doc.isClass() ? serialClassInclude((ClassDoc) doc) : serialDocInclude(doc);
 }