Package com.sun.codemodel
Class JDocComment
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractList<E>
-
- java.util.ArrayList<java.lang.Object>
-
- com.sun.codemodel.JCommentPart
-
- com.sun.codemodel.JDocComment
-
- All Implemented Interfaces:
JGenerable,java.io.Serializable,java.lang.Cloneable,java.lang.Iterable<java.lang.Object>,java.util.Collection<java.lang.Object>,java.util.List<java.lang.Object>,java.util.RandomAccess
public class JDocComment extends JCommentPart implements JGenerable
JavaDoc comment.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.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private JCommentPartatDeprecatedThe @deprecated tagprivate java.util.Map<java.lang.String,JCommentPart>atParamslist of @param tagsprivate JCommentPartatReturnThe @return tag part.private java.util.Map<JClass,JCommentPart>atThrowslist of @throws tagsprivate java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>atXdocletslist of xdocletsprivate static java.lang.StringINDENTprivate JCodeModelownerprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description JDocComment(JCodeModel owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JCommentPartaddDeprecated()add an @deprecated tag to the javadoc, with the associated message.JCommentPartaddParam(JVar param)Append a text to an @param tag.JCommentPartaddParam(java.lang.String param)Append a text to a @param tag to the javadocJCommentPartaddReturn()Appends a text to @return tag.JCommentPartaddThrows(JClass exception)add an @throws tag to the javadocJCommentPartaddThrows(java.lang.Class<? extends java.lang.Throwable> exception)add an @throws tag to the javadocjava.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.lang.String attribute, java.lang.String value)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.JDocCommentappend(java.lang.Object o)Appends a new value.voidgenerate(JFormatter f)-
Methods inherited from class com.sun.codemodel.JCommentPart
add, format
-
Methods inherited from class java.util.ArrayList
add, addAll, addAll, clear, clone, contains, ensureCapacity, equals, forEach, get, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
atParams
private final java.util.Map<java.lang.String,JCommentPart> atParams
list of @param tags
-
atXdoclets
private final java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>> atXdoclets
list of xdoclets
-
atThrows
private final java.util.Map<JClass,JCommentPart> atThrows
list of @throws tags
-
atReturn
private JCommentPart atReturn
The @return tag part.
-
atDeprecated
private JCommentPart atDeprecated
The @deprecated tag
-
owner
private final JCodeModel owner
-
INDENT
private static final java.lang.String INDENT
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JDocComment
public JDocComment(JCodeModel owner)
-
-
Method Detail
-
append
public JDocComment append(java.lang.Object o)
Description copied from class:JCommentPartAppends a new value. If the value isJTypeit will be printed as a @link tag. Otherwise it will be converted to String viaObject.toString().- Overrides:
appendin classJCommentPart
-
addParam
public JCommentPart addParam(java.lang.String param)
Append a text to a @param tag to the javadoc
-
addParam
public JCommentPart addParam(JVar param)
Append a text to an @param tag.
-
addThrows
public JCommentPart addThrows(java.lang.Class<? extends java.lang.Throwable> exception)
add an @throws tag to the javadoc
-
addThrows
public JCommentPart addThrows(JClass exception)
add an @throws tag to the javadoc
-
addReturn
public JCommentPart addReturn()
Appends a text to @return tag.
-
addDeprecated
public JCommentPart addDeprecated()
add an @deprecated tag to the javadoc, with the associated message.
-
addXdoclet
public java.util.Map<java.lang.String,java.lang.String> addXdoclet(java.lang.String name)
add an xdoclet.
-
addXdoclet
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)add an xdoclet.
-
addXdoclet
public 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.
-
generate
public void generate(JFormatter f)
- Specified by:
generatein interfaceJGenerable
-
-