コード例 #1
1
ファイル: Util.java プロジェクト: subxiang/jdk-source-code
 /** Return the list of ProgramElementDoc objects as Array. */
 public static ProgramElementDoc[] toProgramElementDocArray(List list) {
   ProgramElementDoc[] pgmarr = new ProgramElementDoc[list.size()];
   for (int i = 0; i < list.size(); i++) {
     pgmarr[i] = (ProgramElementDoc) (list.get(i));
   }
   return pgmarr;
 }
コード例 #2
0
ファイル: ClassTree.java プロジェクト: zgbkny/JavaTools
 /**
  * Return a list of all direct or indirect, sub-classes and subinterfaces of the ClassDoc
  * argument.
  *
  * @param cd ClassDoc whose sub-classes or sub-interfaces are requested.
  * @param isEnum true if the subclasses should be forced to come from the enum tree.
  */
 public List allSubs(ClassDoc cd, boolean isEnum) {
   List list = subs(cd, isEnum);
   for (int i = 0; i < list.size(); i++) {
     cd = (ClassDoc) list.get(i);
     List tlist = subs(cd, isEnum);
     for (int j = 0; j < tlist.size(); j++) {
       ClassDoc tcd = (ClassDoc) tlist.get(j);
       if (!list.contains(tcd)) {
         list.add(tcd);
       }
     }
   }
   Collections.sort(list);
   return list;
 }
コード例 #3
0
 /**
  * Add deprecated information to the documentation tree
  *
  * @param deprmembers list of deprecated members
  * @param headingKey the caption for the deprecated members table
  * @param tableSummary the summary for the deprecated members table
  * @param tableHeader table headers for the deprecated members table
  * @param contentTree the content tree to which the deprecated members table will be added
  */
 protected void addDeprecatedAPI(
     List<Doc> deprmembers,
     String headingKey,
     String tableSummary,
     String[] tableHeader,
     Content contentTree) {
   if (deprmembers.size() > 0) {
     Content caption = writer.getTableCaption(configuration.getResource(headingKey));
     Content table =
         (configuration.isOutputHtml5())
             ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
             : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
     table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
     Content tbody = new HtmlTree(HtmlTag.TBODY);
     for (int i = 0; i < deprmembers.size(); i++) {
       ProgramElementDoc member = (ProgramElementDoc) deprmembers.get(i);
       HtmlTree td = HtmlTree.TD(HtmlStyle.colOne, getDeprecatedLink(member));
       if (member.tags("deprecated").length > 0)
         writer.addInlineDeprecatedComment(member, member.tags("deprecated")[0], td);
       HtmlTree tr = HtmlTree.TR(td);
       if (i % 2 == 0) tr.addStyle(HtmlStyle.altColor);
       else tr.addStyle(HtmlStyle.rowColor);
       tbody.addContent(tr);
     }
     table.addContent(tbody);
     Content li = HtmlTree.LI(HtmlStyle.blockList, table);
     Content ul = HtmlTree.UL(HtmlStyle.blockList, li);
     contentTree.addContent(ul);
   }
 }
コード例 #4
0
  /**
   * Build the comments for the method. Do nothing if {@link Configuration#nocomment} is set to
   * true.
   *
   * @param node the XML element that specifies which components to document
   * @param methodDocTree the content tree to which the documentation will be added
   */
  public void buildMethodComments(XMLNode node, Content methodDocTree) {
    if (!configuration.nocomment) {
      MethodDoc method = (MethodDoc) methods.get(currentMethodIndex);

      if (method.inlineTags().length == 0) {
        DocFinder.Output docs = DocFinder.search(configuration, new DocFinder.Input(method));
        method =
            docs.inlineTags != null && docs.inlineTags.length > 0
                ? (MethodDoc) docs.holder
                : method;
      }
      // NOTE:  When we fix the bug where ClassDoc.interfaceTypes() does
      //       not pass all implemented interfaces, holder will be the
      //       interface type.  For now, it is really the erasure.
      writer.addComments(method.containingClass(), method, methodDocTree);
    }
  }
コード例 #5
0
 /**
  * Build the method documentation.
  *
  * @param node the XML element that specifies which components to document
  * @param memberDetailsTree the content tree to which the documentation will be added
  */
 public void buildMethodDoc(XMLNode node, Content memberDetailsTree) {
   if (writer == null) {
     return;
   }
   int size = methods.size();
   if (size > 0) {
     Content methodDetailsTree = writer.getMethodDetailsTreeHeader(classDoc, memberDetailsTree);
     for (currentMethodIndex = 0; currentMethodIndex < size; currentMethodIndex++) {
       Content methodDocTree =
           writer.getMethodDocTreeHeader(
               (MethodDoc) methods.get(currentMethodIndex), methodDetailsTree);
       buildChildren(node, methodDocTree);
       methodDetailsTree.addContent(
           writer.getMethodDoc(methodDocTree, (currentMethodIndex == size - 1)));
     }
     memberDetailsTree.addContent(writer.getMethodDetails(methodDetailsTree));
   }
 }
コード例 #6
0
 /**
  * Build the field documentation.
  *
  * @param node the XML element that specifies which components to document
  * @param memberDetailsTree the content tree to which the documentation will be added
  */
 public void buildFieldDoc(XMLNode node, Content memberDetailsTree) {
   if (writer == null) {
     return;
   }
   int size = fields.size();
   if (size > 0) {
     Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(classDoc, memberDetailsTree);
     for (currentFieldIndex = 0; currentFieldIndex < size; currentFieldIndex++) {
       Content fieldDocTree =
           writer.getFieldDocTreeHeader(
               (FieldDoc) fields.get(currentFieldIndex), fieldDetailsTree);
       buildChildren(node, fieldDocTree);
       fieldDetailsTree.addContent(
           writer.getFieldDoc(fieldDocTree, (currentFieldIndex == size - 1)));
     }
     memberDetailsTree.addContent(writer.getFieldDetails(fieldDetailsTree));
   }
 }
コード例 #7
0
 /** Build the deprecation information. */
 public void buildDeprecationInfo() {
   writer.writeDeprecated((FieldDoc) fields.get(currentFieldIndex));
 }
コード例 #8
0
 /**
  * Build the signature.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldDocTree the content tree to which the documentation will be added
  */
 public void buildSignature(XMLNode node, Content fieldDocTree) {
   fieldDocTree.addContent(writer.getSignature((FieldDoc) fields.get(currentFieldIndex)));
 }
コード例 #9
0
 /** Build the tag information. */
 public void buildTagInfo() {
   writer.writeTags((FieldDoc) enumConstants.get(currentEnumConstantsIndex));
 }
コード例 #10
0
 /**
  * Build the comments for the enum constant. Do nothing if {@link Configuration#nocomment} is set
  * to true.
  */
 public void buildEnumConstantComments() {
   if (!configuration.nocomment) {
     writer.writeComments((FieldDoc) enumConstants.get(currentEnumConstantsIndex));
   }
 }
コード例 #11
0
 /** Build the deprecation information. */
 public void buildDeprecationInfo() {
   writer.writeDeprecated((FieldDoc) enumConstants.get(currentEnumConstantsIndex));
 }
コード例 #12
0
 /** Build the signature. */
 public void buildSignature() {
   writer.writeSignature((FieldDoc) enumConstants.get(currentEnumConstantsIndex));
 }
コード例 #13
0
 /** Build the header for the individual enum constants. */
 public void buildEnumConstantHeader() {
   writer.writeEnumConstantHeader(
       (FieldDoc) enumConstants.get(currentEnumConstantsIndex), currentEnumConstantsIndex == 0);
 }
コード例 #14
0
 /**
  * Build the deprecation information.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldDocTree the content tree to which the documentation will be added
  */
 public void buildDeprecationInfo(XMLNode node, Content fieldDocTree) {
   writer.addDeprecated((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
 }
コード例 #15
0
 /**
  * Build the signature.
  *
  * @param node the XML element that specifies which components to document
  * @param methodDocTree the content tree to which the documentation will be added
  */
 public void buildSignature(XMLNode node, Content methodDocTree) {
   methodDocTree.addContent(writer.getSignature((MethodDoc) methods.get(currentMethodIndex)));
 }
コード例 #16
0
 /** Build the signature. */
 public void buildSignature() {
   writer.writeSignature((FieldDoc) fields.get(currentFieldIndex));
 }
コード例 #17
0
 /** Build the header for the individual field. */
 public void buildFieldHeader() {
   writer.writeFieldHeader((FieldDoc) fields.get(currentFieldIndex), currentFieldIndex == 0);
 }
コード例 #18
0
 /**
  * Build the comments for the field. Do nothing if {@link Configuration#nocomment} is set to true.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldDocTree the content tree to which the documentation will be added
  */
 public void buildFieldComments(XMLNode node, Content fieldDocTree) {
   if (!configuration.nocomment) {
     writer.addComments((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
   }
 }
コード例 #19
0
 /**
  * Build the tag information.
  *
  * @param node the XML element that specifies which components to document
  * @param fieldDocTree the content tree to which the documentation will be added
  */
 public void buildTagInfo(XMLNode node, Content fieldDocTree) {
   writer.addTags((FieldDoc) fields.get(currentFieldIndex), fieldDocTree);
 }
コード例 #20
0
 /**
  * Build the deprecation information.
  *
  * @param node the XML element that specifies which components to document
  * @param methodDocTree the content tree to which the documentation will be added
  */
 public void buildDeprecationInfo(XMLNode node, Content methodDocTree) {
   writer.addDeprecated((MethodDoc) methods.get(currentMethodIndex), methodDocTree);
 }
コード例 #21
0
 /**
  * Build the comments for the field. Do nothing if {@link Configuration#nocomment} is set to true.
  */
 public void buildFieldComments() {
   if (!configuration.nocomment) {
     writer.writeComments((FieldDoc) fields.get(currentFieldIndex));
   }
 }
コード例 #22
0
 /**
  * Build the tag information.
  *
  * @param node the XML element that specifies which components to document
  * @param methodDocTree the content tree to which the documentation will be added
  */
 public void buildTagInfo(XMLNode node, Content methodDocTree) {
   writer.addTags((MethodDoc) methods.get(currentMethodIndex), methodDocTree);
 }
コード例 #23
0
 /** Build the tag information. */
 public void buildTagInfo() {
   writer.writeTags((FieldDoc) fields.get(currentFieldIndex));
 }