public class JSDoc extends Object
| Modifier and Type | Field and Description |
|---|---|
static Pattern |
authorPattern
A regexp that matches JavaDoc
@author expressions. |
static Pattern |
linkPattern
A regexp that matches JavaDoc
@link expressions. |
static Pattern |
paramPattern
A regexp that matches JavaDoc
@param expressions. |
static Pattern |
returnPattern
A regexp that matches JavaDoc
@return expression. |
| Modifier and Type | Method and Description |
|---|---|
static String |
adaptDocComment(JSweetContext context,
com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit,
com.sun.tools.javac.tree.JCTree element,
String commentText)
Adapts the JavaDoc comment for a given element to conform to JSDoc.
|
static String |
getMappedDocType(JSweetContext context,
com.sun.tools.javac.tree.JCTree typeTree,
com.sun.tools.javac.code.Type type)
Gets the JSDoc type from a Java type tree and/or type.
|
static String |
replaceLinks(JSweetContext context,
String text)
Replaces Java links by JSDoc links in a doc text.
|
public static final Pattern paramPattern
@param expressions.public static final Pattern authorPattern
@author expressions.public static final Pattern returnPattern
@return expression.public static final Pattern linkPattern
@link expressions.public static String getMappedDocType(JSweetContext context, com.sun.tools.javac.tree.JCTree typeTree, com.sun.tools.javac.code.Type type)
typeTree - the Java type treetype - the Java typepublic static String replaceLinks(JSweetContext context, String text)
public static String adaptDocComment(JSweetContext context, com.sun.tools.javac.tree.JCTree.JCCompilationUnit compilationUnit, com.sun.tools.javac.tree.JCTree element, String commentText)
By default, this implementation does not auto-generate comments. This behavior can be overridden by adding a line in the comment before calling this method. For example:
public String adaptDocComment(JCTree element, String commentText) {
if (commentText == null) {
return "My default comment";
}
super(element, commentText);
}
element - the documented elementcommentText - the comment text if any (null when no comment)