|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectsidekick.ecmascript.parser.Comment
public class Comment
Objects of this class hold multi-line c-style comments in original source form and for javadoc comments also parsed and broken down into tags. API exists to query the tags, get the comment body and beautifying the comment body that turns plain text into more formatted html according to some wild guesses and silly heuristics.
| Nested Class Summary | |
|---|---|
static class |
Comment.Tag
Simple class holding a javadoc tag |
| Constructor Summary | |
|---|---|
Comment(java.lang.String comment)
Creates an instance of Comment from the specified comment
string |
|
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Comment(java.lang.String comment)
throws java.lang.Exception
Comment from the specified comment
string
comment - comment string
java.lang.Exception - if parsing the comment generates a parsing error| Method Detail |
|---|
public 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 string
public java.lang.String getHtmlifiedCommentBody()
public java.util.List<Comment.Tag> getTags()
public java.lang.String getTag(java.lang.String key)
key - javadoc tag key
public java.util.List<java.lang.String> getTags(java.lang.String key)
key - javadoc tag key
public java.util.List<Comment.Tag> getTags(java.util.regex.Pattern pattern)
pattern - javadoc tag pattern
public boolean containsTag(java.lang.String key)
true if receiver has a javadoc tag matching
specified key.
key - javadoc tag key
true 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.Objectpublic static void main(java.lang.String[] args)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||