Interface JComment
- All Known Subinterfaces:
JDocComment, JHtmlComment, JHtmlTag
- All Known Implementing Classes:
AbstractJComment, AbstractJDocComment, AbstractJHtmlComment, BlockJComment, DocTagJHtmlComment, ImplJDocComment, ImplJHtmlTag, InlineDocTagCommentContent, LineJComment, NestedCommentContent, NestedDocCommentContent, NestedHtmlCommentContent
public interface JComment
A source comment or tag body.
-
Method Summary
Modifier and TypeMethodDescriptionblock()Add a comment sub-block at this location.code()Add an inline code tag.docRoot()Add the{@docRoot}tag at this position.inlineDocTag(String tag) Add an inline doc tag.inlineDocTag(String tag, String body) Add an inline doc tag with simple content.linkConstructor(boolean plain, JType targetType, JType... targetConstructorArgumentTypes) Add an inline@linkto a constructor.Add an inline@linkto a field of a type.linkMethod(boolean plain, JMethodDef methodDef) Add an inline@linkto a method.linkMethod(boolean plain, JType targetType, String targetMethod, JType... targetMethodArgumentTypes) Add an inline@linkto a method.Add an inline@linkto a type.nl()Add a newline.sp()Add a non-trailing space.Add some text to the end of this comment.Add a type name to the end of this comment.
-
Method Details
-
text
-
sp
JComment sp()Add a non-trailing space. If no content follows, the space will be omitted.- Returns:
- this comment
-
nl
-
typeName
-
block
JComment block()Add a comment sub-block at this location. The block has no visual representation but allows text to be inserted at the point of the block even after more content was appended after it.- Returns:
- the comment sub-block
-
inlineDocTag
-
inlineDocTag
-
code
-
docRoot
-
linkType
-
linkField
Add an inline@linkto a field of a type.- Parameters:
plain-trueto render in plain font,falseto render inmonospacefonttargetType- the target type to link totargetField- the target field to link to- Returns:
- the body of the link tag
-
linkConstructor
Add an inline@linkto a constructor.- Parameters:
plain-trueto render in plain font,falseto render inmonospacefonttargetType- the target type to link totargetConstructorArgumentTypes- the argument types of the constructor to link to- Returns:
- the body of the link tag
-
linkMethod
JComment linkMethod(boolean plain, JType targetType, String targetMethod, JType... targetMethodArgumentTypes) Add an inline@linkto a method.- Parameters:
plain-trueto render in plain font,falseto render inmonospacefonttargetType- the target type to link totargetMethod- the name of the method to link totargetMethodArgumentTypes- the argument types of the method to link to- Returns:
- the body of the link tag
-
linkMethod
Add an inline@linkto a method.- Parameters:
plain-trueto render in plain font,falseto render inmonospacefontmethodDef- the method to link to- Returns:
- the body of the link tag
-