src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java

changeset 1751
ca8808c88f94
parent 1724
d918b63a5509
child 2525
2eb010b6cb22
     1.1 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java	Tue May 14 10:14:56 2013 -0700
     1.2 +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java	Tue May 14 10:14:57 2013 -0700
     1.3 @@ -28,6 +28,7 @@
     1.4  import java.util.*;
     1.5  
     1.6  import com.sun.javadoc.*;
     1.7 +import com.sun.tools.doclets.internal.toolkit.Content;
     1.8  import com.sun.tools.doclets.internal.toolkit.util.*;
     1.9  
    1.10  /**
    1.11 @@ -165,12 +166,12 @@
    1.12       * @param writer the TagletWriter that will write this tag.
    1.13       * @return the TagletOutput representation of these <code>ParamTag</code>s.
    1.14       */
    1.15 -    public TagletOutput getTagletOutput(Doc holder, TagletWriter writer) {
    1.16 +    public Content getTagletOutput(Doc holder, TagletWriter writer) {
    1.17          if (holder instanceof ExecutableMemberDoc) {
    1.18              ExecutableMemberDoc member = (ExecutableMemberDoc) holder;
    1.19 -            TagletOutput output = getTagletOutput(false, member, writer,
    1.20 +            Content output = getTagletOutput(false, member, writer,
    1.21                  member.typeParameters(), member.typeParamTags());
    1.22 -            output.appendOutput(getTagletOutput(true, member, writer,
    1.23 +            output.addContent(getTagletOutput(true, member, writer,
    1.24                  member.parameters(), member.paramTags()));
    1.25              return output;
    1.26          } else {
    1.27 @@ -191,12 +192,12 @@
    1.28       *
    1.29       * @return the TagletOutput representation of these <code>ParamTag</code>s.
    1.30       */
    1.31 -    private TagletOutput getTagletOutput(boolean isNonTypeParams, Doc holder,
    1.32 +    private Content getTagletOutput(boolean isNonTypeParams, Doc holder,
    1.33              TagletWriter writer, Object[] formalParameters, ParamTag[] paramTags) {
    1.34 -        TagletOutput result = writer.getOutputInstance();
    1.35 +        Content result = writer.getOutputInstance();
    1.36          Set<String> alreadyDocumented = new HashSet<String>();
    1.37          if (paramTags.length > 0) {
    1.38 -            result.appendOutput(
    1.39 +            result.addContent(
    1.40                  processParamTags(isNonTypeParams, paramTags,
    1.41                  getRankMap(formalParameters), writer, alreadyDocumented)
    1.42              );
    1.43 @@ -204,7 +205,7 @@
    1.44          if (alreadyDocumented.size() != formalParameters.length) {
    1.45              //Some parameters are missing corresponding @param tags.
    1.46              //Try to inherit them.
    1.47 -            result.appendOutput(getInheritedTagletOutput (isNonTypeParams, holder,
    1.48 +            result.addContent(getInheritedTagletOutput (isNonTypeParams, holder,
    1.49                  writer, formalParameters, alreadyDocumented));
    1.50          }
    1.51          return result;
    1.52 @@ -214,10 +215,10 @@
    1.53       * Loop through each indivitual parameter.  It it does not have a
    1.54       * corresponding param tag, try to inherit it.
    1.55       */
    1.56 -    private TagletOutput getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
    1.57 +    private Content getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
    1.58              TagletWriter writer, Object[] formalParameters,
    1.59              Set<String> alreadyDocumented) {
    1.60 -        TagletOutput result = writer.getOutputInstance();
    1.61 +        Content result = writer.getOutputInstance();
    1.62          if ((! alreadyDocumented.contains(null)) &&
    1.63                  holder instanceof MethodDoc) {
    1.64              for (int i = 0; i < formalParameters.length; i++) {
    1.65 @@ -231,7 +232,7 @@
    1.66                          String.valueOf(i), ! isNonTypeParams));
    1.67                  if (inheritedDoc.inlineTags != null &&
    1.68                          inheritedDoc.inlineTags.length > 0) {
    1.69 -                    result.appendOutput(
    1.70 +                    result.addContent(
    1.71                          processParamTag(isNonTypeParams, writer,
    1.72                              (ParamTag) inheritedDoc.holderTag,
    1.73                              isNonTypeParams ?
    1.74 @@ -261,12 +262,12 @@
    1.75       *                of a rank of a parameter to its name.  This is
    1.76       *                used to ensure that the right name is used
    1.77       *                when parameter documentation is inherited.
    1.78 -     * @return the TagletOutput representation of this <code>Tag</code>.
    1.79 +     * @return the Content representation of this <code>Tag</code>.
    1.80       */
    1.81 -    private TagletOutput processParamTags(boolean isNonTypeParams,
    1.82 +    private Content processParamTags(boolean isNonTypeParams,
    1.83              ParamTag[] paramTags, Map<String, String> rankMap, TagletWriter writer,
    1.84              Set<String> alreadyDocumented) {
    1.85 -        TagletOutput result = writer.getOutputInstance();
    1.86 +        Content result = writer.getOutputInstance();
    1.87          if (paramTags.length > 0) {
    1.88              for (int i = 0; i < paramTags.length; ++i) {
    1.89                  ParamTag pt = paramTags[i];
    1.90 @@ -287,7 +288,7 @@
    1.91                             "doclet.Type_Parameters_dup_warn",
    1.92                         paramName);
    1.93                  }
    1.94 -                result.appendOutput(processParamTag(isNonTypeParams, writer, pt,
    1.95 +                result.addContent(processParamTag(isNonTypeParams, writer, pt,
    1.96                       pt.parameterName(), alreadyDocumented.size() == 0));
    1.97                  alreadyDocumented.add(rank);
    1.98              }
    1.99 @@ -295,7 +296,7 @@
   1.100          return result;
   1.101      }
   1.102      /**
   1.103 -     * Convert the individual ParamTag into TagletOutput.
   1.104 +     * Convert the individual ParamTag into Content.
   1.105       *
   1.106       * @param isNonTypeParams true if this is just a regular param tag.  False
   1.107       *                        if this is a type param tag.
   1.108 @@ -307,16 +308,16 @@
   1.109       * @param isFirstParam    true if this is the first param tag being printed.
   1.110       *
   1.111       */
   1.112 -    private TagletOutput processParamTag(boolean isNonTypeParams,
   1.113 +    private Content processParamTag(boolean isNonTypeParams,
   1.114              TagletWriter writer, ParamTag paramTag, String name,
   1.115              boolean isFirstParam) {
   1.116 -        TagletOutput result = writer.getOutputInstance();
   1.117 +        Content result = writer.getOutputInstance();
   1.118          String header = writer.configuration().getText(
   1.119              isNonTypeParams ? "doclet.Parameters" : "doclet.TypeParameters");
   1.120          if (isFirstParam) {
   1.121 -            result.appendOutput(writer.getParamHeader(header));
   1.122 +            result.addContent(writer.getParamHeader(header));
   1.123          }
   1.124 -        result.appendOutput(writer.paramTagOutput(paramTag,
   1.125 +        result.addContent(writer.paramTagOutput(paramTag,
   1.126              name));
   1.127          return result;
   1.128      }

mercurial