Package org.jboss.jdeparser
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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description 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.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... targetConstructorArgumentTypes)
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... targetMethodArgumentTypes)
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.
-
-
-
Method Detail
-
text
JComment text(java.lang.String text)
Add some text to the end of this comment. No formatting or line breaks are inserted.- Parameters:
text
- the text to add- Returns:
- this comment
-
sp
JComment sp()
Add a non-trailing space. If no content follows, the space will be omitted.- Returns:
- this comment
-
nl
JComment nl()
Add a newline.- Returns:
- this comment
-
typeName
JComment typeName(JType type)
Add a type name to the end of this comment. If the type is imported, it will emit as a simple name, otherwise it will emit as a qualified name.- Parameters:
type
- the type name to add- Returns:
- this comment
-
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
JComment inlineDocTag(java.lang.String tag, java.lang.String body)
Add an inline doc tag with simple content.- Parameters:
tag
- the tag name (without the leading@
sign)body
- the complete tag body- Returns:
- this comment
-
inlineDocTag
JComment inlineDocTag(java.lang.String tag)
Add an inline doc tag.- Parameters:
tag
- the tag name (without the leading@
sign)- Returns:
- the body of the doc tag
-
code
JComment code()
Add an inline code tag.- Returns:
- the code tag content
-
docRoot
JComment docRoot()
Add the{@docRoot}
tag at this position.- Returns:
- this comment
-
linkType
JComment linkType(boolean plain, JType targetType)
Add an inline@link
to a type.- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fonttargetType
- the target type to link to- Returns:
- the body of the link tag
-
linkField
JComment linkField(boolean plain, JType targetType, java.lang.String targetField)
Add an inline@link
to a field of a type.- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fonttargetType
- the target type to link totargetField
- the target field to link to- Returns:
- the body of the link tag
-
linkConstructor
JComment linkConstructor(boolean plain, JType targetType, JType... targetConstructorArgumentTypes)
Add an inline@link
to a constructor.- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fonttargetType
- 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, java.lang.String targetMethod, JType... targetMethodArgumentTypes)
Add an inline@link
to a method.- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fonttargetType
- 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
JComment linkMethod(boolean plain, JMethodDef methodDef)
Add an inline@link
to a method.- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fontmethodDef
- the method to link to- Returns:
- the body of the link tag
-
-