コード例 #1
0
 /**
  * Build the summaries for the methods that belong to the given class.
  *
  * @param node the XML element that specifies which components to document
  * @param classContentTree content tree to which the documentation will be added
  */
 public void buildSerializableMethods(XMLNode node, Content classContentTree) {
   Content serializableMethodTree = methodWriter.getSerializableMethodsHeader();
   MemberDoc[] members = currentClass.serializationMethods();
   int membersLength = members.length;
   if (membersLength > 0) {
     for (int i = 0; i < membersLength; i++) {
       currentMember = members[i];
       Content methodsContentTree = methodWriter.getMethodsContentHeader((i == membersLength - 1));
       buildChildren(node, methodsContentTree);
       serializableMethodTree.addContent(methodsContentTree);
     }
   }
   if (currentClass.serializationMethods().length > 0) {
     classContentTree.addContent(
         methodWriter.getSerializableMethods(
             configuration.getText("doclet.Serialized_Form_methods"), serializableMethodTree));
     if (currentClass.isSerializable() && !currentClass.isExternalizable()) {
       if (currentClass.serializationMethods().length == 0) {
         Content noCustomizationMsg =
             methodWriter.getNoCustomizationMsg(
                 configuration.getText("doclet.Serializable_no_customization"));
         classContentTree.addContent(
             methodWriter.getSerializableMethods(
                 configuration.getText("doclet.Serialized_Form_methods"), noCustomizationMsg));
       }
     }
   }
 }
コード例 #2
0
  /**
   * Constructor.
   *
   * @param filename the file to be generated.
   * @throws IOException
   * @throws DocletAbortException
   */
  public PackageUseWriter(
      ConfigurationImpl configuration, ClassUseMapper mapper, DocPath filename, PackageDoc pkgdoc)
      throws IOException {
    super(configuration, DocPath.forPackage(pkgdoc).resolve(filename));
    this.pkgdoc = pkgdoc;

    // by examining all classes in this package, find what packages
    // use these classes - produce a map between using package and
    // used classes.
    ClassDoc[] content = pkgdoc.allClasses();
    for (int i = 0; i < content.length; ++i) {
      ClassDoc usedClass = content[i];
      Set<ClassDoc> usingClasses = mapper.classToClass.get(usedClass.qualifiedName());
      if (usingClasses != null) {
        for (Iterator<ClassDoc> it = usingClasses.iterator(); it.hasNext(); ) {
          ClassDoc usingClass = it.next();
          PackageDoc usingPackage = usingClass.containingPackage();
          Set<ClassDoc> usedClasses = usingPackageToUsedClasses.get(usingPackage.name());
          if (usedClasses == null) {
            usedClasses = new TreeSet<ClassDoc>();
            usingPackageToUsedClasses.put(Util.getPackageName(usingPackage), usedClasses);
          }
          usedClasses.add(usedClass);
        }
      }
    }
  }
コード例 #3
0
 /**
  * Add use information to the documentation tree.
  *
  * @param mems list of program elements for which the use information will be added
  * @param heading the section heading
  * @param tableSummary the summary for the use table
  * @param contentTree the content tree to which the use information will be added
  */
 protected void addUseInfo(
     List<? extends ProgramElementDoc> mems,
     Content heading,
     String tableSummary,
     Content contentTree) {
   if (mems == null) {
     return;
   }
   List<? extends ProgramElementDoc> members = mems;
   boolean printedUseTableHeader = false;
   if (members.size() > 0) {
     Content caption = writer.getTableCaption(heading);
     Content table =
         (configuration.isOutputHtml5())
             ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
             : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
     Content tbody = new HtmlTree(HtmlTag.TBODY);
     Iterator<? extends ProgramElementDoc> it = members.iterator();
     for (int i = 0; it.hasNext(); i++) {
       ProgramElementDoc pgmdoc = it.next();
       ClassDoc cd = pgmdoc.containingClass();
       if (!printedUseTableHeader) {
         table.addContent(writer.getSummaryTableHeader(this.getSummaryTableHeader(pgmdoc), "col"));
         printedUseTableHeader = true;
       }
       HtmlTree tr = new HtmlTree(HtmlTag.TR);
       if (i % 2 == 0) {
         tr.addStyle(HtmlStyle.altColor);
       } else {
         tr.addStyle(HtmlStyle.rowColor);
       }
       HtmlTree tdFirst = new HtmlTree(HtmlTag.TD);
       tdFirst.addStyle(HtmlStyle.colFirst);
       writer.addSummaryType(this, pgmdoc, tdFirst);
       tr.addContent(tdFirst);
       HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
       tdLast.addStyle(HtmlStyle.colLast);
       if (cd != null && !(pgmdoc instanceof ConstructorDoc) && !(pgmdoc instanceof ClassDoc)) {
         HtmlTree name = new HtmlTree(HtmlTag.SPAN);
         name.addStyle(HtmlStyle.typeNameLabel);
         name.addContent(cd.name() + ".");
         tdLast.addContent(name);
       }
       addSummaryLink(
           pgmdoc instanceof ClassDoc ? LinkInfoImpl.Kind.CLASS_USE : LinkInfoImpl.Kind.MEMBER,
           cd,
           pgmdoc,
           tdLast);
       writer.addSummaryLinkComment(this, pgmdoc, tdLast);
       tr.addContent(tdLast);
       tbody.addContent(tr);
     }
     table.addContent(tbody);
     contentTree.addContent(table);
   }
 }
コード例 #4
0
 /**
  * Build the field information.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldsContentTree content tree to which the documentation will be added
  */
 public void buildFieldInfo(XMLNode node, Content fieldsContentTree) {
   if (configuration.nocomment) {
     return;
   }
   FieldDoc field = (FieldDoc) currentMember;
   ClassDoc cd = field.containingClass();
   // Process default Serializable field.
   if ((field.tags("serial").length == 0) && !field.isSynthetic() && configuration.serialwarn) {
     configuration.message.warning(
         field.position(), "doclet.MissingSerialTag", cd.qualifiedName(), field.name());
   }
   fieldWriter.addMemberDescription(field, fieldsContentTree);
   fieldWriter.addMemberTags(field, fieldsContentTree);
 }
コード例 #5
0
ファイル: ParamTaglet.java プロジェクト: java66liu/classlib6
 /**
  * Given an array of <code>ParamTag</code>s,return its string representation.
  *
  * @param holder the member that holds the param tags.
  * @param writer the TagletWriter that will write this tag.
  * @return the TagletOutput representation of these <code>ParamTag</code>s.
  */
 public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
   if (holder instanceof ExecutableMemberDoc) {
     ExecutableMemberDoc member = (ExecutableMemberDoc) holder;
     TagletOutput output =
         getTagletOutput(false, member, writer, member.typeParameters(), member.typeParamTags());
     output.appendOutput(
         getTagletOutput(true, member, writer, member.parameters(), member.paramTags()));
     return output;
   } else {
     ClassDoc classDoc = (ClassDoc) holder;
     return getTagletOutput(
         false, classDoc, writer, classDoc.typeParameters(), classDoc.typeParamTags());
   }
 }
コード例 #6
0
 /**
  * Return true if the given <code>ProgramElement</code> is inherited by the class that is being
  * documented.
  *
  * @param ped The <code>ProgramElement</code> being checked. return true if the <code>
  *     ProgramElement</code> is being inherited and false otherwise.
  */
 protected boolean isInherited(ProgramElementDoc ped) {
   if (ped.isPrivate()
       || (ped.isPackagePrivate()
           && !ped.containingPackage().equals(classdoc.containingPackage()))) {
     return false;
   }
   return true;
 }
コード例 #7
0
 /**
  * Add the navigation summary link.
  *
  * @param members members to be linked
  * @param visibleMemberMap the visible inherited members map
  * @param liNav the content tree to which the navigation summary link will be added
  */
 protected void addNavSummaryLink(
     List<?> members, VisibleMemberMap visibleMemberMap, Content liNav) {
   if (members.size() > 0) {
     liNav.addContent(getNavSummaryLink(null, true));
     return;
   }
   ClassDoc icd = classdoc.superclass();
   while (icd != null) {
     List<?> inhmembers = visibleMemberMap.getMembersFor(icd);
     if (inhmembers.size() > 0) {
       liNav.addContent(getNavSummaryLink(icd, true));
       return;
     }
     icd = icd.superclass();
   }
   liNav.addContent(getNavSummaryLink(null, false));
 }
コード例 #8
0
 /**
  * Write out class use pages.
  *
  * @throws DocletAbortException
  */
 public static void generate(ConfigurationImpl configuration, ClassTree classtree) {
   ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree);
   for (ClassDoc aClass : configuration.root.classes()) {
     // If -nodeprecated option is set and the containing package is marked
     // as deprecated, do not generate the class-use page. We will still generate
     // the class-use page if the class is marked as deprecated but the containing
     // package is not since it could still be linked from that package-use page.
     if (!(configuration.nodeprecated && Util.isDeprecated(aClass.containingPackage())))
       ClassUseWriter.generate(configuration, mapper, aClass);
   }
   for (PackageDoc pkg : configuration.packages) {
     // If -nodeprecated option is set and the package is marked
     // as deprecated, do not generate the package-use page.
     if (!(configuration.nodeprecated && Util.isDeprecated(pkg)))
       PackageUseWriter.generate(configuration, mapper, pkg);
   }
 }
コード例 #9
0
 /**
  * Get the tree link.
  *
  * @return a content tree for the tree link
  */
 protected Content getNavLinkTree() {
   Content linkContent =
       classdoc.containingPackage().isIncluded()
           ? getHyperLink(DocPath.parent.resolve(DocPaths.PACKAGE_TREE), treeLabel)
           : getHyperLink(pathToRoot.resolve(DocPaths.OVERVIEW_TREE), treeLabel);
   Content li = HtmlTree.LI(linkContent);
   return li;
 }
コード例 #10
0
ファイル: HtmlDocWriter.java プロジェクト: AllenWeb/openjdk-1
 /**
  * Get the name of the package, this class is in.
  *
  * @param cd ClassDoc.
  */
 public String getPkgName(ClassDoc cd) {
   String pkgName = cd.containingPackage().name();
   if (pkgName.length() > 0) {
     pkgName += ".";
     return pkgName;
   }
   return "";
 }
コード例 #11
0
 void generate() {
   if (rootDoc == null || outputdir == null) {
     return;
   }
   for (PackageDoc pd : rootDoc.specifiedPackages()) {
     // If -nodeprecated option is set and the package is marked as deprecated,
     // do not convert the package files to HTML.
     if (!(configuration.nodeprecated && utils.isDeprecated(pd))) convertPackage(pd, outputdir);
   }
   for (ClassDoc cd : rootDoc.specifiedClasses()) {
     // If -nodeprecated option is set and the class is marked as deprecated
     // or the containing package is deprecated, do not convert the
     // package files to HTML.
     if (!(configuration.nodeprecated
         && (utils.isDeprecated(cd) || utils.isDeprecated(cd.containingPackage()))))
       convertClass(cd, outputdir);
   }
 }
コード例 #12
0
 /**
  * Add a row for the class that uses the given package.
  *
  * @param usedClass the class that uses the given package
  * @param packageName the name of the package to which the class belongs
  * @param contentTree the content tree to which the row will be added
  */
 protected void addClassRow(ClassDoc usedClass, String packageName, Content contentTree) {
   DocPath dp = pathString(usedClass, DocPaths.CLASS_USE.resolve(DocPath.forName(usedClass)));
   Content td =
       HtmlTree.TD(
           HtmlStyle.colOne,
           getHyperLink(dp.fragment(packageName), new StringContent(usedClass.name())));
   addIndexComment(usedClass, td);
   contentTree.addContent(td);
 }
コード例 #13
0
 /**
  * Get the header for the class use Listing.
  *
  * @return a content tree representing the class use header
  */
 protected Content getClassUseHeader() {
   String cltype =
       configuration.getText(classdoc.isInterface() ? "doclet.Interface" : "doclet.Class");
   String clname = classdoc.qualifiedName();
   String title = configuration.getText("doclet.Window_ClassUse_Header", cltype, clname);
   Content bodyTree = getBody(true, getWindowTitle(title));
   addTop(bodyTree);
   addNavLinks(true, bodyTree);
   ContentBuilder headContent = new ContentBuilder();
   headContent.addContent(getResource("doclet.ClassUse_Title", cltype));
   headContent.addContent(new HtmlTree(HtmlTag.BR));
   headContent.addContent(clname);
   Content heading =
       HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING, true, HtmlStyle.title, headContent);
   Content div = HtmlTree.DIV(HtmlStyle.header, heading);
   bodyTree.addContent(div);
   return bodyTree;
 }
コード例 #14
0
 /**
  * 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);
 }
コード例 #15
0
 /**
  * Build the field sub header.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldsContentTree content tree to which the documentation will be added
  */
 public void buildFieldSubHeader(XMLNode node, Content fieldsContentTree) {
   if (!currentClass.definesSerializableFields()) {
     FieldDoc field = (FieldDoc) currentMember;
     fieldWriter.addMemberHeader(
         field.type().asClassDoc(),
         field.type().typeName(),
         field.type().dimension(),
         field.name(),
         fieldsContentTree);
   }
 }
コード例 #16
0
 /**
  * Build the serialization overview for the given class.
  *
  * @param classDoc the class to print the overview for.
  * @param classContentTree content tree to which the documentation will be added
  */
 public void buildFieldSerializationOverview(ClassDoc classDoc, Content classContentTree) {
   if (classDoc.definesSerializableFields()) {
     FieldDoc serialPersistentField = classDoc.serializableFields()[0];
     // Check to see if there are inline comments, tags or deprecation
     // information to be printed.
     if (fieldWriter.shouldPrintOverview(serialPersistentField)) {
       Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader();
       Content fieldsOverviewContentTree = fieldWriter.getFieldsContentHeader(true);
       fieldWriter.addMemberDeprecatedInfo(serialPersistentField, fieldsOverviewContentTree);
       if (!configuration.nocomment) {
         fieldWriter.addMemberDescription(serialPersistentField, fieldsOverviewContentTree);
         fieldWriter.addMemberTags(serialPersistentField, fieldsOverviewContentTree);
       }
       serializableFieldsTree.addContent(fieldsOverviewContentTree);
       classContentTree.addContent(
           fieldWriter.getSerializableFields(
               configuration.getText("doclet.Serialized_Form_class"), serializableFieldsTree));
     }
   }
 }
コード例 #17
0
 /**
  * Build the summaries for the fields that belong to the given class.
  *
  * @param node the XML element that specifies which components to document
  * @param classContentTree content tree to which the documentation will be added
  */
 public void buildSerializableFields(XMLNode node, Content classContentTree) {
   MemberDoc[] members = currentClass.serializableFields();
   int membersLength = members.length;
   if (membersLength > 0) {
     Content serializableFieldsTree = fieldWriter.getSerializableFieldsHeader();
     for (int i = 0; i < membersLength; i++) {
       currentMember = members[i];
       if (!currentClass.definesSerializableFields()) {
         Content fieldsContentTree = fieldWriter.getFieldsContentHeader((i == membersLength - 1));
         buildChildren(node, fieldsContentTree);
         serializableFieldsTree.addContent(fieldsContentTree);
       } else {
         buildSerialFieldTagsInfo(serializableFieldsTree);
       }
     }
     classContentTree.addContent(
         fieldWriter.getSerializableFields(
             configuration.getText("doclet.Serialized_Form_fields"), serializableFieldsTree));
   }
 }
コード例 #18
0
 /**
  * Build the serial UID information for the given class.
  *
  * @param node the XML element that specifies which components to document
  * @param classTree content tree to which the serial UID information will be added
  */
 public void buildSerialUIDInfo(XMLNode node, Content classTree) {
   Content serialUidTree = writer.getSerialUIDInfoHeader();
   FieldDoc[] fields = currentClass.fields(false);
   for (int i = 0; i < fields.length; i++) {
     if (fields[i].name().equals("serialVersionUID")
         && fields[i].constantValueExpression() != null) {
       writer.addSerialUIDInfo(
           SERIAL_VERSION_UID_HEADER, fields[i].constantValueExpression(), serialUidTree);
       break;
     }
   }
   classTree.addContent(serialUidTree);
 }
コード例 #19
0
 /** Generate the class use list. */
 protected void generateClassUseFile() throws IOException {
   Content body = getClassUseHeader();
   HtmlTree div = new HtmlTree(HtmlTag.DIV);
   div.addStyle(HtmlStyle.classUseContainer);
   if (pkgSet.size() > 0) {
     addClassUse(div);
   } else {
     div.addContent(getResource("doclet.ClassUse_No.usage.of.0", classdoc.qualifiedName()));
   }
   body.addContent(div);
   addNavLinks(false, body);
   addBottom(body);
   printHtmlDocument(null, true, body);
 }
コード例 #20
0
ファイル: ThrowsTaglet.java プロジェクト: karianna/jdk8_tl
 /**
  * Given an array of <code>Tag</code>s representing this custom tag, return its string
  * representation.
  *
  * @param throwTags the array of <code>ThrowsTag</code>s to convert.
  * @param writer the TagletWriter that will write this tag.
  * @param alreadyDocumented the set of exceptions that have already been documented.
  * @param allowDups True if we allow duplicate throws tags to be documented.
  * @return the TagletOutput representation of this <code>Tag</code>.
  */
 protected TagletOutput throwsTagsOutput(
     ThrowsTag[] throwTags,
     TagletWriter writer,
     Set<String> alreadyDocumented,
     boolean allowDups) {
   TagletOutput result = writer.getOutputInstance();
   if (throwTags.length > 0) {
     for (int i = 0; i < throwTags.length; ++i) {
       ThrowsTag tt = throwTags[i];
       ClassDoc cd = tt.exception();
       if ((!allowDups)
           && (alreadyDocumented.contains(tt.exceptionName())
               || (cd != null && alreadyDocumented.contains(cd.qualifiedName())))) {
         continue;
       }
       if (alreadyDocumented.size() == 0) {
         result.appendOutput(writer.getThrowsHeader());
       }
       result.appendOutput(writer.throwsTagOutput(tt));
       alreadyDocumented.add(cd != null ? cd.qualifiedName() : tt.exceptionName());
     }
   }
   return result;
 }
コード例 #21
0
 /**
  * Add the package annotation list.
  *
  * @param contentTree the content tree to which the package annotation list will be added
  */
 protected void addPackageAnnotationList(Content contentTree) throws IOException {
   if ((!classdoc.isAnnotationType())
       || pkgToPackageAnnotations == null
       || pkgToPackageAnnotations.isEmpty()) {
     return;
   }
   Content table =
       HtmlTree.TABLE(
           HtmlStyle.useSummary,
           0,
           3,
           0,
           useTableSummary,
           getTableCaption(
               configuration.getResource(
                   "doclet.ClassUse_PackageAnnotation",
                   getLink(
                       new LinkInfoImpl(
                           configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
   table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
   Content tbody = new HtmlTree(HtmlTag.TBODY);
   Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
   for (int i = 0; it.hasNext(); i++) {
     PackageDoc pkg = it.next();
     HtmlTree tr = new HtmlTree(HtmlTag.TR);
     if (i % 2 == 0) {
       tr.addStyle(HtmlStyle.altColor);
     } else {
       tr.addStyle(HtmlStyle.rowColor);
     }
     Content tdFirst =
         HtmlTree.TD(HtmlStyle.colFirst, getPackageLink(pkg, new StringContent(pkg.name())));
     tr.addContent(tdFirst);
     HtmlTree tdLast = new HtmlTree(HtmlTag.TD);
     tdLast.addStyle(HtmlStyle.colLast);
     addSummaryComment(pkg, tdLast);
     tr.addContent(tdLast);
     tbody.addContent(tr);
   }
   table.addContent(tbody);
   Content li = HtmlTree.LI(HtmlStyle.blockList, table);
   contentTree.addContent(li);
 }
コード例 #22
0
 private Map<String, List<ProgramElementDoc>> pkgDivide(
     Map<String, ? extends List<? extends ProgramElementDoc>> classMap) {
   Map<String, List<ProgramElementDoc>> map = new HashMap<>();
   List<? extends ProgramElementDoc> list = classMap.get(classdoc.qualifiedName());
   if (list != null) {
     Collections.sort(list);
     for (ProgramElementDoc doc : list) {
       PackageDoc pkg = doc.containingPackage();
       pkgSet.add(pkg);
       List<ProgramElementDoc> inPkg = map.get(pkg.name());
       if (inPkg == null) {
         inPkg = new ArrayList<>();
         map.put(pkg.name(), inPkg);
       }
       inPkg.add(doc);
     }
   }
   return map;
 }
コード例 #23
0
 /**
  * Convert the given Class to an HTML.
  *
  * @param cd the class to convert.
  * @param outputdir the name of the directory to output to.
  */
 public void convertClass(ClassDoc cd, DocPath outputdir) {
   if (cd == null) {
     return;
   }
   try {
     SourcePosition sp = cd.position();
     if (sp == null) return;
     Reader r;
     // temp hack until we can update SourcePosition API.
     if (sp instanceof SourcePositionImpl) {
       FileObject fo = ((SourcePositionImpl) sp).fileObject();
       if (fo == null) return;
       r = fo.openReader(true);
     } else {
       File file = sp.file();
       if (file == null) return;
       r = new FileReader(file);
     }
     int lineno = 1;
     String line;
     relativePath = DocPaths.SOURCE_OUTPUT.resolve(DocPath.forPackage(cd)).invert();
     Content body = getHeader();
     Content pre = new HtmlTree(HtmlTag.PRE);
     try (LineNumberReader reader = new LineNumberReader(r)) {
       while ((line = reader.readLine()) != null) {
         addLineNo(pre, lineno);
         addLine(pre, line, lineno);
         lineno++;
       }
     }
     addBlankLines(pre);
     Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
     body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div);
     writeToFile(body, outputdir.resolve(DocPath.forClass(cd)));
   } catch (IOException e) {
     e.printStackTrace();
   }
 }
コード例 #24
0
 /**
  * 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;
 }
コード例 #25
0
 /**
  * Constructor.
  *
  * @param filename the file to be generated.
  * @throws IOException
  * @throws DocletAbortException
  */
 public ClassUseWriter(
     ConfigurationImpl configuration, ClassUseMapper mapper, DocPath filename, ClassDoc classdoc)
     throws IOException {
   super(configuration, filename);
   this.classdoc = classdoc;
   if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName()))
     pkgToPackageAnnotations =
         new TreeSet<>(mapper.classToPackageAnnotations.get(classdoc.qualifiedName()));
   configuration.currentcd = classdoc;
   this.pkgSet = new TreeSet<>();
   this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam);
   this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations);
   this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam);
   this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam);
   this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam);
   this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc);
   this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam);
   this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations);
   this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation);
   this.pkgToSubclass = pkgDivide(mapper.classToSubclass);
   this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface);
   this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass);
   this.pkgToField = pkgDivide(mapper.classToField);
   this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn);
   this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs);
   this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows);
   this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations);
   this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation);
   this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs);
   this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam);
   this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows);
   // tmp test
   if (pkgSet.size() > 0
       && mapper.classToPackage.containsKey(classdoc.qualifiedName())
       && !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) {
     configuration.root.printWarning(
         "Internal error: package sets don't match: "
             + pkgSet
             + " with: "
             + mapper.classToPackage.get(classdoc.qualifiedName()));
   }
   methodSubWriter = new MethodWriterImpl(this);
   constrSubWriter = new ConstructorWriterImpl(this);
   fieldSubWriter = new FieldWriterImpl(this);
   classSubWriter = new NestedClassWriterImpl(this);
   classUseTableSummary =
       configuration.getText("doclet.Use_Table_Summary", configuration.getText("doclet.classes"));
   subclassUseTableSummary =
       configuration.getText(
           "doclet.Use_Table_Summary", configuration.getText("doclet.subclasses"));
   subinterfaceUseTableSummary =
       configuration.getText(
           "doclet.Use_Table_Summary", configuration.getText("doclet.subinterfaces"));
   fieldUseTableSummary =
       configuration.getText("doclet.Use_Table_Summary", configuration.getText("doclet.fields"));
   methodUseTableSummary =
       configuration.getText("doclet.Use_Table_Summary", configuration.getText("doclet.methods"));
   constructorUseTableSummary =
       configuration.getText(
           "doclet.Use_Table_Summary", configuration.getText("doclet.constructors"));
 }
コード例 #26
0
 /**
  * Build the field header.
  *
  * @param node the XML element that specifies which components to document
  * @param classContentTree content tree to which the documentation will be added
  */
 public void buildFieldHeader(XMLNode node, Content classContentTree) {
   if (currentClass.serializableFields().length > 0) {
     buildFieldSerializationOverview(currentClass, classContentTree);
   }
 }
コード例 #27
0
 /**
  * Build the field deprecation information.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldsContentTree content tree to which the documentation will be added
  */
 public void buildFieldDeprecationInfo(XMLNode node, Content fieldsContentTree) {
   if (!currentClass.definesSerializableFields()) {
     FieldDoc field = (FieldDoc) currentMember;
     fieldWriter.addMemberDeprecatedInfo(field, fieldsContentTree);
   }
 }