public class JDocComment extends JCommentPart implements IJGenerable, IJOwned
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.
modCount
Modifier | Constructor and Description |
---|---|
protected |
JDocComment(JCodeModel owner) |
Modifier and Type | Method and Description |
---|---|
JCommentPart |
addAuthor()
Appends a text to @author tag.
|
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(String param)
Append a text to a @param tag to the javadoc
|
JCommentPart |
addReturn()
Appends a text to @return tag.
|
JCommentPart |
addThrows(AbstractJClass exception)
add an @throws tag to the javadoc
|
JCommentPart |
addThrows(Class<? extends Throwable> exception)
add an @throws tag to the javadoc
|
Map<String,String> |
addXdoclet(String name)
add an xdoclet.
|
Map<String,String> |
addXdoclet(String name,
Map<String,String> attributes)
add an xdoclet.
|
Map<String,String> |
addXdoclet(String name,
String attribute,
String value)
add an xdoclet.
|
JDocComment |
append(Object o)
Appends a new value.
|
void |
generate(JFormatter f) |
JCommentPart |
getParam(JVar param) |
JCommentPart |
getParam(String param) |
JCommentPart |
getThrows(AbstractJClass exception) |
JCommentPart |
getThrows(Class<? extends Throwable> exception) |
JCodeModel |
owner()
Gets the owner code model object.
|
void |
removeAllParams() |
void |
removeAllThrows() |
void |
removeAllXdoclets() |
void |
removeAuthor() |
void |
removeDeprecated() |
JCommentPart |
removeParam(JVar param) |
JCommentPart |
removeParam(String param) |
void |
removeReturn() |
JCommentPart |
removeThrows(AbstractJClass exception) |
JCommentPart |
removeThrows(Class<? extends Throwable> exception) |
Map<String,String> |
removeXdoclet(String name) |
add, format
add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
protected JDocComment(@Nonnull JCodeModel owner)
@Nonnull public JCodeModel owner()
IJOwned
public JDocComment append(@Nullable Object o)
JCommentPart
append
in class JCommentPart
o
- If the value is AbstractJType
it will be printed as a @link
tag. Otherwise it will be converted to String via
Object.toString()
.@Nonnull public JCommentPart addParam(String param)
param
- Parameter to be addedJCommentPart
public JCommentPart addParam(@Nonnull JVar param)
param
- Parameter to be addedJCommentPart
@Nullable public JCommentPart removeParam(String param)
@Nullable public JCommentPart removeParam(@Nonnull JVar param)
public void removeAllParams()
@Nullable public JCommentPart getParam(@Nullable String param)
@Nullable public JCommentPart getParam(@Nonnull JVar param)
public JCommentPart addThrows(@Nonnull Class<? extends Throwable> exception)
exception
- Exception to be addedJCommentPart
public JCommentPart addThrows(AbstractJClass exception)
exception
- Exception to be addedJCommentPart
@Nullable public JCommentPart removeThrows(@Nonnull Class<? extends Throwable> exception)
@Nullable public JCommentPart removeThrows(AbstractJClass exception)
public void removeAllThrows()
@Nullable public JCommentPart getThrows(@Nonnull Class<? extends Throwable> exception)
@Nullable public JCommentPart getThrows(AbstractJClass exception)
@Nonnull public JCommentPart addReturn()
JCommentPart
public void removeReturn()
@Nonnull public JCommentPart addAuthor()
JCommentPart
public void removeAuthor()
@Nonnull public JCommentPart addDeprecated()
JCommentPart
public void removeDeprecated()
@Nonnull public Map<String,String> addXdoclet(String name)
name
- xdoclet name@Nonnull public Map<String,String> addXdoclet(String name, Map<String,String> attributes)
name
- xdoclet nameattributes
- Attributes to be added@Nonnull public Map<String,String> addXdoclet(String name, String attribute, String value)
name
- xdoclet nameattribute
- Attribute name to be addedvalue
- Attribute value to be addedpublic void removeAllXdoclets()
public void generate(@Nonnull JFormatter f)
generate
in interface IJGenerable
Copyright © 2013–2015 Philip Helger. All rights reserved.