Exemple #1
0
 public static Type findSuperType(final Type type, String typeName) {
   ClassDoc doc = type.asClassDoc();
   if (doc == null) return null;
   if (doc.isInterface()) return findSuperTypeFromInterface(doc, typeName);
   if (doc.isClass() && !doc.isEnum() && !doc.isError() && !doc.isException())
     return findSuperTypeFromClass(doc, typeName);
   return null;
 }
Exemple #2
0
 /**
  * Return the sub-class/interface list for the class/interface passed.
  *
  * @param cd class/interface whose sub-class/interface list is required.
  * @param isEnum true if the subclasses should be forced to come from the enum tree.
  */
 public List subs(ClassDoc cd, boolean isEnum) {
   if (isEnum) {
     return get(subEnums, cd);
   } else if (cd.isAnnotationType()) {
     return get(subAnnotationTypes, cd);
   } else if (cd.isInterface()) {
     return get(subinterfaces, cd);
   } else if (cd.isClass()) {
     return get(subclasses, cd);
   } else {
     return null;
   }
 }
Exemple #3
0
  public static ClassDoc findAnnotatedClass(
      final ClassDoc klass, final Class<?>... soughtAnnotations) {
    if (!klass.isClass() || isExcluded(klass)) return null;
    if (hasAnnotation(klass, soughtAnnotations)) {
      return klass;
    }
    // find it in the interfaces
    final ClassDoc foundClassDoc = findAnnotatedInterface(klass, soughtAnnotations);
    if (foundClassDoc != null) {
      return foundClassDoc;
    }

    final Type superclass = klass.superclassType();
    if (superclass != null && superclass.asClassDoc() != null) {
      return findAnnotatedClass(superclass.asClassDoc(), soughtAnnotations);
    }
    return null;
  }
 /**
  * Build the class serialized form.
  *
  * @param node the XML element that specifies which components to document
  * @param packageSerializedTree content tree to which the documentation will be added
  */
 public void buildClassSerializedForm(XMLNode node, Content packageSerializedTree) {
   Content classSerializedTree = writer.getClassSerializedHeader();
   ClassDoc[] classes = currentPackage.allClasses(false);
   Arrays.sort(classes);
   for (int j = 0; j < classes.length; j++) {
     currentClass = classes[j];
     fieldWriter = writer.getSerialFieldWriter(currentClass);
     methodWriter = writer.getSerialMethodWriter(currentClass);
     if (currentClass.isClass() && currentClass.isSerializable()) {
       if (!serialClassInclude(currentClass)) {
         continue;
       }
       Content classTree = writer.getClassHeader(currentClass);
       buildChildren(node, classTree);
       classSerializedTree.addContent(classTree);
     }
   }
   packageSerializedTree.addContent(classSerializedTree);
 }