abstract class AbstractJComment extends java.lang.Object implements JComment, Writable
Modifier and Type | Field and Description |
---|---|
(package private) static CommentTextContent |
CLOSE_PAREN_CONTENT |
(package private) static CommentTextContent |
COMMA_CONTENT |
private java.util.List<Writable> |
content |
(package private) static InlineDocTagCommentContent |
DOC_ROOT_CONTENT |
(package private) static CommentTextContent |
HASH_CONTENT |
(package private) static CommentContent |
NL_CONTENT |
(package private) static CommentTextContent |
OPEN_PAREN_CONTENT |
Constructor and Description |
---|
AbstractJComment() |
Modifier and Type | Method and Description |
---|---|
protected <T extends CommentContent> |
add(T item) |
(package private) void |
addItemDirectly(Writable item) |
JComment |
block()
Add a comment sub-block at this location.
|
JComment |
code()
Add an inline code tag.
|
JComment |
docRoot()
Add the
{@docRoot} tag at this position. |
(package private) java.util.List<Writable> |
getContent() |
JComment |
inlineDocTag(java.lang.String tag)
Add an inline doc tag.
|
JComment |
inlineDocTag(java.lang.String tag,
java.lang.String body)
Add an inline doc tag with simple content.
|
JComment |
linkConstructor(boolean plain,
JType targetType,
JType... params)
Add an inline
@link to a constructor. |
JComment |
linkField(boolean plain,
JType targetType,
java.lang.String targetField)
Add an inline
@link to a field of a type. |
JComment |
linkMethod(boolean plain,
JMethodDef methodDef)
Add an inline
@link to a method. |
JComment |
linkMethod(boolean plain,
JType targetType,
java.lang.String targetMethod,
JType... params)
Add an inline
@link to a method. |
JComment |
linkType(boolean plain,
JType targetType)
Add an inline
@link to a type. |
JComment |
nl()
Add a newline.
|
JComment |
sp()
Add a non-trailing space.
|
JComment |
text(java.lang.String text)
Add some text to the end of this comment.
|
JComment |
typeName(JType type)
Add a type name to the end of this comment.
|
void |
write(SourceFileWriter writer) |
static final CommentContent NL_CONTENT
static final CommentTextContent HASH_CONTENT
static final CommentTextContent OPEN_PAREN_CONTENT
static final CommentTextContent COMMA_CONTENT
static final CommentTextContent CLOSE_PAREN_CONTENT
static final InlineDocTagCommentContent DOC_ROOT_CONTENT
private java.util.List<Writable> content
void addItemDirectly(Writable item)
protected <T extends CommentContent> T add(T item)
public JComment text(java.lang.String text)
JComment
public JComment sp()
JComment
public JComment typeName(JType type)
JComment
public JComment block()
JComment
public JComment inlineDocTag(java.lang.String tag, java.lang.String body)
JComment
inlineDocTag
in interface JComment
tag
- the tag name (without the leading @
sign)body
- the complete tag bodypublic JComment inlineDocTag(java.lang.String tag)
JComment
inlineDocTag
in interface JComment
tag
- the tag name (without the leading @
sign)public JComment linkType(boolean plain, JType targetType)
JComment
@link
to a type.public JComment linkField(boolean plain, JType targetType, java.lang.String targetField)
JComment
@link
to a field of a type.public JComment linkConstructor(boolean plain, JType targetType, JType... params)
JComment
@link
to a constructor.linkConstructor
in interface JComment
plain
- true
to render in plain font, false
to render in monospace
fonttargetType
- the target type to link toparams
- the argument types of the constructor to link topublic JComment linkMethod(boolean plain, JType targetType, java.lang.String targetMethod, JType... params)
JComment
@link
to a method.linkMethod
in interface JComment
plain
- true
to render in plain font, false
to render in monospace
fonttargetType
- the target type to link totargetMethod
- the name of the method to link toparams
- the argument types of the method to link topublic JComment linkMethod(boolean plain, JMethodDef methodDef)
JComment
@link
to a method.linkMethod
in interface JComment
plain
- true
to render in plain font, false
to render in monospace
fontmethodDef
- the method to link topublic JComment docRoot()
JComment
{@docRoot}
tag at this position.public void write(SourceFileWriter writer) throws java.io.IOException
java.util.List<Writable> getContent()