示例#1
0
 /**
  * Given a class, return the closest visible super class.
  *
  * @param classDoc the class we are searching the parent for.
  * @param configuration the current configuration of the doclet.
  * @return the closest visible super class. Return null if it cannot be found (i.e. classDoc is
  *     java.lang.Object).
  */
 public static Type getFirstVisibleSuperClass(ClassDoc classDoc, Configuration configuration) {
   if (classDoc == null) {
     return null;
   }
   Type sup = classDoc.superclassType();
   ClassDoc supClassDoc = classDoc.superclass();
   while (sup != null && (!(supClassDoc.isPublic() || isLinkable(supClassDoc, configuration)))) {
     if (supClassDoc.superclass().qualifiedName().equals(supClassDoc.qualifiedName())) break;
     sup = supClassDoc.superclassType();
     supClassDoc = supClassDoc.superclass();
   }
   if (classDoc.equals(supClassDoc)) {
     return null;
   }
   return sup;
 }
示例#2
0
 private static void findAllInterfaceTypes(
     Map results, ClassDoc c, boolean raw, Configuration configuration) {
   Type superType = c.superclassType();
   if (superType == null) return;
   addAllInterfaceTypes(
       results,
       superType,
       superType instanceof ClassDoc
           ? ((ClassDoc) superType).interfaceTypes()
           : ((ParameterizedType) superType).interfaceTypes(),
       raw,
       configuration);
 }
 /**
  * Return true if the given ClassDoc should be included in the serialized form.
  *
  * @param cd the ClassDoc object to check for serializability.
  */
 private static boolean serialClassInclude(ClassDoc cd) {
   if (cd.isEnum()) {
     return false;
   }
   try {
     cd.superclassType();
   } catch (NullPointerException e) {
     // Workaround for null pointer bug in ClassDoc.superclassType().
     return false;
   }
   if (cd.isSerializable()) {
     if (cd.tags("serial").length > 0) {
       return serialDocInclude(cd);
     } else if (cd.isPublic() || cd.isProtected()) {
       return true;
     } else {
       return false;
     }
   }
   return false;
 }