 Javadoc Tool API.
JavaDocToolJavaDoc Tool is a custom tool class used for creating a Document node. - create() - Return a new instance of a Document node. Each JavaDoc comment must start with /** and ended with */.
- createForText() - Return a new instance of a Document node. This method allows in-complete JavaDoc (comments without /** and */) to be loaded with JavaDocTool.
DocumentDocument is an interface representing a Comment Document. - getRawComment() - Return the full unprocessed text of the comment.
- getTags() - Return all tags in this document item.
- getTags(tagName : String) - Return a tag of the specified kind of this document item.
- get(tagName : String) - Return a tag of the specified kind of this document item. If any tags with the same kind are found, the first tag of that kind will be returned.
DocumentImplDocumentImpl is a default JavaDoc document implementation. - getComment() - Return formatted text for this document.
- getInlineTags() - Return comment as a collection of tags.
- getFirstSentenceTags() - Return the first sentence of the comment as a collection of tags.
TagTag is an interface representing a simple documentation tag, such as @since, @author, and @version - getKind() - Return the kind of this tag.
- getText() - Return the text of this tag.
- getInlineTags() - Return a collection of tags for a documentation comment with embedded {@link} tags.
TagImplTagImpl is a default tag implementation. - getRawText() - Return the full unprocessed text of this tag.
- toString() - Return the text of this tag. Usually calls getText().
ParamTagParamTag represents a @param documentation tag. - getName() - Return the name of the parameter associated with this tag.
- getComment() - Return the parameter’s comment.
ThrowsTagThrowsTag represents a @throws or @exception documentation tag. - getName() - Return the name of the exception associated with this tag.
- getComment() - Return the exception’s comment.
SeeTagSeeTag represents a user-defined cross-reference to related documentation. The reference can be either inline with the comment using {@link} or a separate block comment using @see. - getLabel() - Return the label of the @see tag.
- getReference() - Return the MODEL or URL of the @see reference.
- getLink() - Return the Link object representing this tag.
SerialFieldTagSerialFieldTag represents a @serialField tag. - getFieldName() - return the serial field name.
- getFieldDescription() - return the field comment.
- getFieldType() - return the field type string.
For examples: - Import the Javadoc tool and create an instance of Javadoc document:
#import ("javadoc",
"com.nomagic.reportwizard.tools.doc.JavaDocTool")
#set ($doc = $javadoc.create($comment)) |
- Print the first encountered author:
#foreach ($author in $doc.getTags("author"))
$author.text
#end |
- Print the first sentence:
#foreach ($tag in $doc.firstSentenceTags)
$tag.text
#end |
#foreach ($tag in $doc.inlineTags)
$tag.kind
$tag.text
#end |
- Print a raw comment (plain text without a document parser or HTML renderer):
#foreach ($tag in $doc.tags)
$tag.kind : $tag.text
#end |
#foreach ($tag in $doc.getTags("param"))
$tag.name - $tag.comment
#end |
#foreach ($tag in $doc.getTags("throws"))
$tag.name - $tag.comment
#end |
#foreach ($tag in $doc.getTags("see"))
$tag.label - $tag.reference
#end |
Reference Documents |