예제 #1
0
 /** Add links for exceptions that are declared but not documented. */
 private TagletOutput linkToUndocumentedDeclaredExceptions(
     Type[] declaredExceptionTypes, Set<String> alreadyDocumented, TagletWriter writer) {
   TagletOutput result = writer.getOutputInstance();
   // Add links to the exceptions declared but not documented.
   for (int i = 0; i < declaredExceptionTypes.length; i++) {
     if (declaredExceptionTypes[i].asClassDoc() != null
         && !alreadyDocumented.contains(declaredExceptionTypes[i].asClassDoc().name())
         && !alreadyDocumented.contains(declaredExceptionTypes[i].asClassDoc().qualifiedName())) {
       if (alreadyDocumented.size() == 0) {
         result.appendOutput(writer.getThrowsHeader());
       }
       result.appendOutput(writer.throwsTagOutput(declaredExceptionTypes[i]));
       alreadyDocumented.add(declaredExceptionTypes[i].asClassDoc().name());
     }
   }
   return result;
 }
예제 #2
0
 /**
  * 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;
 }