public class JDocComment extends JCommentPart implements JGenerable
A javadoc comment consists of multiple parts. There's the main part (that comes the first in in the comment section), then the parameter parts (@param), the return part (@return), and the throws parts (@throws). TODO: it would be nice if we have JComment class and we can derive this class from there.
| Modifier and Type | Field and Description |
|---|---|
private JCommentPart |
atDeprecated
The @deprecated tag
|
private java.util.Map<java.lang.String,JCommentPart> |
atParams
list of @param tags
|
private JCommentPart |
atReturn
The @return tag part.
|
private java.util.Map<JClass,JCommentPart> |
atThrows
list of @throws tags
|
private java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> |
atXdoclets
list of xdoclets
|
private static java.lang.String |
INDENT |
private JCodeModel |
owner |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
JDocComment(JCodeModel owner) |
| Modifier and Type | Method and Description |
|---|---|
JCommentPart |
addDeprecated()
add an @deprecated tag to the javadoc, with the associated message.
|
JCommentPart |
addParam(JVar param)
Append a text to an @param tag.
|
JCommentPart |
addParam(java.lang.String param)
Append a text to a @param tag to the javadoc
|
JCommentPart |
addReturn()
Appends a text to @return tag.
|
JCommentPart |
addThrows(java.lang.Class<? extends java.lang.Throwable> exception)
add an @throws tag to the javadoc
|
JCommentPart |
addThrows(JClass exception)
add an @throws tag to the javadoc
|
java.util.Map<java.lang.String,java.lang.String> |
addXdoclet(java.lang.String name)
add an xdoclet.
|
java.util.Map<java.lang.String,java.lang.String> |
addXdoclet(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
add an xdoclet.
|
java.util.Map<java.lang.String,java.lang.String> |
addXdoclet(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
add an xdoclet.
|
JDocComment |
append(java.lang.Object o)
Appends a new value.
|
void |
generate(JFormatter f) |
add, formatadd, addAll, addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSizeprivate static final long serialVersionUID
private final java.util.Map<java.lang.String,JCommentPart> atParams
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> atXdoclets
private final java.util.Map<JClass,JCommentPart> atThrows
private JCommentPart atReturn
private JCommentPart atDeprecated
private final JCodeModel owner
private static final java.lang.String INDENT
public JDocComment(JCodeModel owner)
public JDocComment append(java.lang.Object o)
JCommentPartJType it will be printed as a @link tag.
Otherwise it will be converted to String via Object.toString().append in class JCommentPartpublic JCommentPart addParam(java.lang.String param)
public JCommentPart addParam(JVar param)
public JCommentPart addThrows(java.lang.Class<? extends java.lang.Throwable> exception)
public JCommentPart addThrows(JClass exception)
public JCommentPart addReturn()
public JCommentPart addDeprecated()
public java.util.Map<java.lang.String,java.lang.String> addXdoclet(java.lang.String name)
public java.util.Map<java.lang.String,java.lang.String> addXdoclet(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> attributes)
public java.util.Map<java.lang.String,java.lang.String> addXdoclet(java.lang.String name,
java.lang.String attribute,
java.lang.String value)
public void generate(JFormatter f)
generate in interface JGenerable