Package org.jboss.jdeparser
Class AbstractJComment
java.lang.Object
org.jboss.jdeparser.AbstractJComment
- Direct Known Subclasses:
AbstractJHtmlComment
,BlockJComment
,InlineDocTagCommentContent
,LineJComment
,NestedCommentContent
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final CommentTextContent
(package private) static final CommentTextContent
(package private) static final InlineDocTagCommentContent
(package private) static final CommentTextContent
(package private) static final CommentContent
(package private) static final CommentTextContent
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected <T extends CommentContent>
Tadd
(T item) (package private) void
addItemDirectly
(Writable item) block()
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... params) Add an inline@link
to a constructor.Add an inline@link
to a field of a type.linkMethod
(boolean plain, JMethodDef methodDef) Add an inline@link
to a method.linkMethod
(boolean plain, JType targetType, String targetMethod, JType... params) Add an inline@link
to a method.Add an inline@link
to 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.void
write
(SourceFileWriter writer)
-
Field Details
-
NL_CONTENT
-
HASH_CONTENT
-
OPEN_PAREN_CONTENT
-
COMMA_CONTENT
-
CLOSE_PAREN_CONTENT
-
DOC_ROOT_CONTENT
-
-
-
Constructor Details
-
AbstractJComment
AbstractJComment()
-
-
Method Details
-
addItemDirectly
-
add
-
text
Description copied from interface:JComment
Add some text to the end of this comment. No formatting or line breaks are inserted. -
sp
Description copied from interface:JComment
Add a non-trailing space. If no content follows, the space will be omitted. -
typeName
Description copied from interface:JComment
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. -
block
Description copied from interface:JComment
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. -
inlineDocTag
Description copied from interface:JComment
Add an inline doc tag with simple content.- Specified by:
inlineDocTag
in interfaceJComment
- Parameters:
tag
- the tag name (without the leading@
sign)body
- the complete tag body- Returns:
- this comment
-
inlineDocTag
Description copied from interface:JComment
Add an inline doc tag.- Specified by:
inlineDocTag
in interfaceJComment
- Parameters:
tag
- the tag name (without the leading@
sign)- Returns:
- the body of the doc tag
-
linkType
Description copied from interface:JComment
Add an inline@link
to a type. -
linkField
Description copied from interface:JComment
Add an inline@link
to a field of a type. -
linkConstructor
Description copied from interface:JComment
Add an inline@link
to a constructor.- Specified by:
linkConstructor
in interfaceJComment
- Parameters:
plain
-true
to render in plain font,false
to render inmonospace
fonttargetType
- the target type to link toparams
- the argument types of the constructor to link to- Returns:
- the body of the link tag
-
linkMethod
Description copied from interface:JComment
Add an inline@link
to a method.- Specified by:
linkMethod
in interfaceJComment
- 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 toparams
- the argument types of the method to link to- Returns:
- the body of the link tag
-
linkMethod
Description copied from interface:JComment
Add an inline@link
to a method.- Specified by:
linkMethod
in interfaceJComment
- 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
-
code
Description copied from interface:JComment
Add an inline code tag. -
docRoot
Description copied from interface:JComment
Add the{@docRoot}
tag at this position. -
nl
Description copied from interface:JComment
Add a newline. -
write
- Specified by:
write
in interfaceWritable
- Throws:
IOException
-
getContent
-