Top Description Fields Constructors Methods
com.sun.codemodel

public Class JDocComment

extends JCommentPart
implements JGenerable
Class Inheritance
All Implemented Interfaces
com.sun.codemodel.JGenerable
Imports
com.sun.codemodel.util.ClassNameComparator, java.util.HashMap, .Map, .TreeMap

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.

Field Summary

Modifier and TypeField and Description
private JCommentPart
atDeprecated

The @deprecated tag

private final transient Map<String, JCommentPart>
atParams

list of @param tags

private JCommentPart
atReturn

The @return tag part.

private final transient Map<JClass, JCommentPart>
atThrows

list of @throws tags

private final transient Map<String, Map<String, String>>
atXdoclets

list of xdoclets

private static final String
private final transient JCodeModel
private static final long

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public JCommentPart
addDeprecated()

add an @deprecated tag to the javadoc, with the associated message.

public JCommentPart
addParam(String param)

Append a text to a @param tag to the javadoc

public JCommentPart
addParam(JVar param)

Append a text to an @param tag.

public JCommentPart
addReturn()

Appends a text to @return tag.

public JCommentPart
addThrows(Class<? extends Throwable> exception)

add an @throws tag to the javadoc

public JCommentPart
addThrows(JClass exception)

add an @throws tag to the javadoc

public Map<String, String>
addXdoclet(String name)

add an xdoclet.

public Map<String, String>
addXdoclet(String name, Map<String, String> attributes)

add an xdoclet.

public Map<String, String>
addXdoclet(String name, String attribute, String value)

add an xdoclet.

public JDocComment
append(Object o)

Overrides com.sun.codemodel.JCommentPart.append.

Appends a new value.

public JDocComment
appendXML(String s)

Overrides com.sun.codemodel.JCommentPart.appendXML.

Appends a new value with escaped XML.

public void
Inherited from com.sun.codemodel.JCommentPart:
addformat

Field Detail

atDeprecatedback to summary
private JCommentPart atDeprecated

The @deprecated tag

atParamsback to summary
private final transient Map<String, JCommentPart> atParams

list of @param tags

atReturnback to summary
private JCommentPart atReturn

The @return tag part.

atThrowsback to summary
private final transient Map<JClass, JCommentPart> atThrows

list of @throws tags

atXdocletsback to summary
private final transient Map<String, Map<String, String>> atXdoclets

list of xdoclets

INDENTback to summary
private static final String INDENT
ownerback to summary
private final transient JCodeModel owner
serialVersionUIDback to summary
private static final long serialVersionUID

Hides com.sun.codemodel.JCommentPart.serialVersionUID.

Constructor Detail

JDocCommentback to summary
public JDocComment(JCodeModel owner)

Method Detail

addDeprecatedback to summary
public JCommentPart addDeprecated()

add an @deprecated tag to the javadoc, with the associated message.

addParamback to summary
public JCommentPart addParam(String param)

Append a text to a @param tag to the javadoc

addParamback to summary
public JCommentPart addParam(JVar param)

Append a text to an @param tag.

addReturnback to summary
public JCommentPart addReturn()

Appends a text to @return tag.

addThrowsback to summary
public JCommentPart addThrows(Class<? extends Throwable> exception)

add an @throws tag to the javadoc

addThrowsback to summary
public JCommentPart addThrows(JClass exception)

add an @throws tag to the javadoc

addXdocletback to summary
public Map<String, String> addXdoclet(String name)

add an xdoclet.

addXdocletback to summary
public Map<String, String> addXdoclet(String name, Map<String, String> attributes)

add an xdoclet.

addXdocletback to summary
public Map<String, String> addXdoclet(String name, String attribute, String value)

add an xdoclet.

appendback to summary
public JDocComment append(Object o)

Overrides com.sun.codemodel.JCommentPart.append.

Doc from com.sun.codemodel.JCommentPart.append.

Appends a new value. If the value is JType it will be printed as a @link tag. Otherwise it will be converted to String via Object#toString().

Annotations
@Override
appendXMLback to summary
public JDocComment appendXML(String s)

Overrides com.sun.codemodel.JCommentPart.appendXML.

Doc from com.sun.codemodel.JCommentPart.appendXML.

Appends a new value with escaped XML. If the value is JType it will be printed as a @link tag. Otherwise it will be converted to String via Object#toString().

Annotations
@Override
generateback to summary
public void generate(JFormatter f)

Implements com.sun.codemodel.JGenerable.generate.

Annotations
@Override