Java 类com.sun.javadoc.ThrowsTag 实例源码

项目:javaontracks    文件:JOTDocletNavView.java   
private String buildThrowTag(ThrowsTag tag)
{
    String result = "";
    if (tag.exception() == null)
    {
        result = "<font class='tagInfo'>" + tag.exceptionName() + "</font>";
    } else
    {
        String link = getItemLink(tag.exception());
        if (link == null)
        {
            result = "<font class='tagInfo'>" + tag.exception().qualifiedName() + "</font>";
        } else
        {
            result = "<a href='" + link + "'>" + tag.exceptionName() + "</a>";
        }
    }
    result += " - " + tag.exceptionComment();
    return result;
}
项目:javaontracks    文件:JOTDocletNavView.java   
public String getTagText(Tag tag)
{
    if (tag.name().equals("@see"))
    {
        try
        {
            return docWriter.seeTagToString((SeeTag) tag);
        } catch (ClassCastException e)
        {
            System.err.println("Error bulding @see tag " + tag.name());
            return tag.text();
        }
    } else if (tag.name().equals("@param"))
    {
        return buildParamTagText((ParamTag) tag);
    } else if (tag.name().equals("@throws") || tag.name().equals("@exception"))
    {
        return buildThrowTag((ThrowsTag) tag);
    }

    return tag.text();
}
项目:xmldoclet    文件:XMLDoclet.java   
/**
 * Returns the XML for the specified exceptions using the throws tags for additional description.
 *
 * @param exceptions exceptions instances to process
 * @param tags       corresponding throws tags (not necessarily in the same order)
 *
 * @return the XML for the specified parameters using the param tags for additional description.
 */
private static XMLNode toExceptionsNode(ClassDoc[] exceptions, ThrowsTag[] tags) {
  if (exceptions.length == 0) return null;

  // Iterate over the exceptions
  XMLNode node = new XMLNode("exceptions");
  for (ClassDoc exception : exceptions) {
    XMLNode n = toExceptionNode(exception, find(tags, exception.name()));
    node.child(n);
  }

  return node;
}
项目:xmldoclet    文件:XMLDoclet.java   
/**
 * Returns the XML for an exception and its corresponding throws tag.
 *
 * @return The corresponding XML.
 */
private static XMLNode toExceptionNode(ClassDoc exception, ThrowsTag tag) {
  if (exception == null) return null;
  XMLNode node = new XMLNode("exception");
  node.attribute("type", exception.typeName());
  node.attribute("fulltype", exception.qualifiedTypeName());
  if (tag != null) {
    node.attribute("comment", tag.exceptionComment());
    node.text(toComment(tag));
  }
  return node;
}
项目:xmldoclet    文件:XMLDoclet.java   
/**
 * Find the corresponding throws tag
 *
 * @return
 */
private static ThrowsTag find(ThrowsTag[] tags, String name){
  for (ThrowsTag tag : tags) {
    if (tag.exceptionName().equalsIgnoreCase(name)) return tag;
  }
  return null;
}
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * @return full JSON objects for the given ThrowsTag[]
 */
protected JSONArray processThrowsTags(ThrowsTag[] throwsTags) {
    JSONArray retMe = new JSONArray();

    for (ThrowsTag throwsTag : throwsTags) {
        retMe.add(processThrowsTag(throwsTag));
    }

    return retMe;
}
项目:javadoc-json-doclet    文件:JsonDoclet.java   
/**
 * @return the full JSON for the given ThrowsTag
 */
protected JSONObject processThrowsTag(ThrowsTag throwsTag) {
    if (throwsTag == null) {
        return null;
    }

    JSONObject retMe = processTag(throwsTag);
    retMe.put("exceptionComment", throwsTag.exceptionComment());
    retMe.put("exceptionName", throwsTag.exceptionName());
    retMe.put("exceptionType", processTypeStub(throwsTag.exceptionType()));

    return retMe;
}
项目:bazooka-wo-xmldoclet    文件:XMLDoclet.java   
/**
 * Returns the XML for the specified exceptions using the throws tags for additional description.
 *
 * @param exceptions exceptions instances to process
 * @param tags       corresponding throws tags (not necessarily in the same order)
 *
 * @return the XML for the specified parameters using the param tags for additional description.
 */
private static XMLNode toExceptionsNode(Type[] exceptions, ThrowsTag[] tags) {
  if (exceptions.length == 0) return null;

  // Iterate over the exceptions
  XMLNode node = new XMLNode("exceptions");
  for (Type exception : exceptions) {
    XMLNode n = toExceptionNode(exception, find(tags, exception.typeName()));
    node.child(n);
  }

  return node;
}
项目:bazooka-wo-xmldoclet    文件:XMLDoclet.java   
/**
 * Returns the XML for an exception and its corresponding throws tag.
 *
 * @return The corresponding XML.
 */
private static XMLNode toExceptionNode(Type exception, ThrowsTag tag) {
  if (exception == null) return null;
  XMLNode node = new XMLNode("exception");
  node.attribute("type", exception.typeName());
  node.attribute("fulltype", exception.qualifiedTypeName());
  if (tag != null) {
    node.attribute("comment", tag.exceptionComment());
    node.text(toComment(tag));
  }
  return node;
}
项目:bazooka-wo-xmldoclet    文件:XMLDoclet.java   
/**
 * Find the corresponding throws tag
 *
 * @return
 */
private static ThrowsTag find(ThrowsTag[] tags, String name){
  for (ThrowsTag tag : tags) {
    if (tag.exceptionName().equalsIgnoreCase(name)) {
      return tag;
    }
  }
  return null;
}
项目:markdown-doclet    文件:ThrowsTagRenderer.java   
@Override
public void render(ThrowsTag tag, StringBuilder target, MarkdownDoclet doclet) {
    target.append(tag.name())
            .append(' ').append(tag.exceptionName())
            .append(' ').append(TagRendering.simplifySingleParagraph(doclet.toHtml(tag.exceptionComment())));
}