public class Comment
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Comment.Tag
Simple class holding a javadoc tag
|
Constructor and Description |
---|
Comment(java.lang.String comment)
Creates an instance of
Comment from the specified comment
string |
Modifier and Type | Method and Description |
---|---|
boolean |
containsTag(java.lang.String key)
Returns
true if receiver has a javadoc tag matching
specified key. |
java.lang.String |
getCommentBody()
Returns the comment body.
|
java.lang.String |
getFirstSentenceInCommentBody(int maxLength)
Returns the first sentence of the comment body (suitable for summary
lines).
|
java.lang.String |
getHtmlifiedCommentBody()
Returns the comment body transforming <plaintext> blocks into
<pre> blocks and escaping all the < and > in there.
|
java.lang.String |
getHtmlifiedSource()
Deprecated.
|
java.util.List |
getLines()
Returns an unmodifiable list of Strings representing the comment body
lines.
|
java.lang.String |
getOriginalSource()
Returns the original comment string.
|
java.lang.String |
getTag(java.lang.String key)
Returns the first javadoc tag value in the list of tags whose key matches
the specified key
|
java.util.List<Comment.Tag> |
getTags()
Returns an unmodifiable list of javadoc tags (instances of Comment.Tag)
|
java.util.List<Comment.Tag> |
getTags(java.util.regex.Pattern pattern)
Returns all javadoc tag values in the list of tags whose keys match the
specified key
|
java.util.List<java.lang.String> |
getTags(java.lang.String key)
Returns all javadoc tag values in the list of tags whose keys match the
specified key
|
boolean |
isJavadoc()
Returns
true if receiver is a javadoc comment. |
static void |
main(java.lang.String[] args) |
static java.lang.String[] |
parseNamedTypedDescription(java.lang.String tagValue) |
static java.lang.String[] |
parseTypedDescription(java.lang.String tagValue) |
java.lang.String |
toString() |
public Comment(java.lang.String comment) throws java.lang.Exception
Comment
from the specified comment
stringcomment
- comment stringjava.lang.Exception
- if parsing the comment generates a parsing errorpublic boolean isJavadoc()
true
if receiver is a javadoc comment.true
if receiver is a javadoc commentpublic java.util.List getLines()
public java.lang.String getCommentBody()
public java.lang.String getFirstSentenceInCommentBody(int maxLength)
maxLength
- maximum length of returned stringpublic java.lang.String getHtmlifiedCommentBody()
public java.util.List<Comment.Tag> getTags()
public java.lang.String getTag(java.lang.String key)
key
- javadoc tag keypublic java.util.List<java.lang.String> getTags(java.lang.String key)
key
- javadoc tag keypublic java.util.List<Comment.Tag> getTags(java.util.regex.Pattern pattern)
pattern
- javadoc tag patternpublic boolean containsTag(java.lang.String key)
true
if receiver has a javadoc tag matching
specified key.key
- javadoc tag keytrue
if receiver has a javadoc tag matching
specified keypublic java.lang.String getOriginalSource()
@Deprecated public java.lang.String getHtmlifiedSource()
public static java.lang.String[] parseNamedTypedDescription(java.lang.String tagValue)
public static java.lang.String[] parseTypedDescription(java.lang.String tagValue)
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)