public ThrowsTagImpl(String text, ClassDocImpl contextClass, MemberDocImpl contextMember) {
    super(text);

    char[] textarr = text.toCharArray();
    int i = 0;
    for (; i < textarr.length; ++i) {
      if (!Parser.isWhitespace(textarr[i])) break;
    }
    for (; i < textarr.length; ++i) {
      if (Parser.isWhitespace(textarr[i])) {
        this.exceptionName = new String(textarr, 0, i).trim();
        this.exceptionComment = new String(textarr, i, textarr.length - i).trim();
        break;
      }
    }
    if (null != exceptionName) {
      if (contextClass == null) {
        this.exception = Main.getRootDoc().classNamed(exceptionName);
      } else {
        this.exception = contextClass.findClass(exceptionName);
      }
      if (exception != null) this.exceptionName = exception.qualifiedName();
      else {
        if (text.trim().startsWith("<")) {
          Main.getRootDoc()
              .printWarning(
                  "Expected exception name but got '"
                      + text
                      + "' in class "
                      + contextClass.getClassName());
        }
      }
    } else {
      Main.getRootDoc()
          .printWarning(
              "@throws tag in comment for "
                  + contextClass.qualifiedName()
                  + "."
                  + contextMember.name()
                  + " doesn't specify an exception.");
    }
    if (this.exceptionComment != null) {
      setBody(this.exceptionComment, contextClass, contextMember);
    }
  }
示例#2
0
 private static boolean isAnnotationTypeElement(MethodSymbol meth) {
   return ClassDocImpl.isAnnotationType(meth.enclClass());
 }