Package org.jboss.jdeparser
Class AbstractJDocComment
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJComment
-
- org.jboss.jdeparser.AbstractJHtmlComment
-
- org.jboss.jdeparser.AbstractJDocComment
-
- All Implemented Interfaces:
JComment
,JDocComment
,JHtmlComment
,Writable
- Direct Known Subclasses:
ImplJDocComment
,NestedDocCommentContent
abstract class AbstractJDocComment extends AbstractJHtmlComment implements JDocComment
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Map<java.lang.String,java.util.List<DocTagJHtmlComment>>
docTags
-
Fields inherited from class org.jboss.jdeparser.AbstractJComment
CLOSE_PAREN_CONTENT, COMMA_CONTENT, DOC_ROOT_CONTENT, HASH_CONTENT, NL_CONTENT, OPEN_PAREN_CONTENT
-
-
Constructor Summary
Constructors Constructor Description AbstractJDocComment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JHtmlComment
_return()
Add a@return
tag.JHtmlComment
_throws(JType exceptionType)
Add a@throws
tag.JDocComment
block()
Add a comment sub-block at this location.JDocComment
br()
Add a line separator.JDocComment
docRoot()
Add the{@docRoot}
tag at this position.JHtmlComment
docTag(java.lang.String tag)
Add a block tag.JHtmlComment
docTag(java.lang.String tag, java.lang.String firstWord)
Add a block tag.(package private) java.util.Map<java.lang.String,java.util.List<DocTagJHtmlComment>>
getDocTags()
JDocComment
inlineDocTag(java.lang.String tag, java.lang.String body)
Add an inline doc tag with simple content.JDocComment
nl()
Add a newline.JDocComment
p()
Add a paragraph separator.JHtmlComment
param(java.lang.String name)
Add a@param
tag.JDocComment
sp()
Add a non-trailing space.JDocComment
text(java.lang.String text)
Add some text to the end of this comment.JDocComment
typeName(JType type)
Add a type name to the end of this comment.JDocComment
value(JType type, java.lang.String fieldName)
Add a@value
inline tag.-
Methods inherited from class org.jboss.jdeparser.AbstractJHtmlComment
add, htmlLink, htmlTag, preformattedCode
-
Methods inherited from class org.jboss.jdeparser.AbstractJComment
add, addItemDirectly, code, getContent, inlineDocTag, linkConstructor, linkField, linkMethod, linkMethod, linkType, write
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jboss.jdeparser.JComment
code, linkConstructor, linkField, linkMethod, linkMethod, linkType
-
Methods inherited from interface org.jboss.jdeparser.JDocComment
inlineDocTag
-
Methods inherited from interface org.jboss.jdeparser.JHtmlComment
htmlLink, htmlTag, preformattedCode
-
-
-
-
Field Detail
-
docTags
private java.util.Map<java.lang.String,java.util.List<DocTagJHtmlComment>> docTags
-
-
Method Detail
-
block
public JDocComment 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.- Specified by:
block
in interfaceJComment
- Specified by:
block
in interfaceJDocComment
- Specified by:
block
in interfaceJHtmlComment
- Overrides:
block
in classAbstractJHtmlComment
- Returns:
- the comment sub-block
-
sp
public JDocComment sp()
Description copied from interface:JComment
Add a non-trailing space. If no content follows, the space will be omitted.- Specified by:
sp
in interfaceJComment
- Specified by:
sp
in interfaceJDocComment
- Specified by:
sp
in interfaceJHtmlComment
- Overrides:
sp
in classAbstractJHtmlComment
- Returns:
- this comment
-
nl
public JDocComment nl()
Description copied from interface:JComment
Add a newline.- Specified by:
nl
in interfaceJComment
- Specified by:
nl
in interfaceJDocComment
- Specified by:
nl
in interfaceJHtmlComment
- Overrides:
nl
in classAbstractJHtmlComment
- Returns:
- this comment
-
typeName
public JDocComment typeName(JType type)
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.- Specified by:
typeName
in interfaceJComment
- Specified by:
typeName
in interfaceJDocComment
- Specified by:
typeName
in interfaceJHtmlComment
- Overrides:
typeName
in classAbstractJHtmlComment
- Parameters:
type
- the type name to add- Returns:
- this comment
-
text
public JDocComment text(java.lang.String text)
Description copied from interface:JComment
Add some text to the end of this comment. No formatting or line breaks are inserted.- Specified by:
text
in interfaceJComment
- Specified by:
text
in interfaceJDocComment
- Specified by:
text
in interfaceJHtmlComment
- Overrides:
text
in classAbstractJHtmlComment
- Parameters:
text
- the text to add- Returns:
- this comment
-
inlineDocTag
public JDocComment inlineDocTag(java.lang.String tag, java.lang.String body)
Description copied from interface:JComment
Add an inline doc tag with simple content.- Specified by:
inlineDocTag
in interfaceJComment
- Specified by:
inlineDocTag
in interfaceJDocComment
- Specified by:
inlineDocTag
in interfaceJHtmlComment
- Overrides:
inlineDocTag
in classAbstractJHtmlComment
- Parameters:
tag
- the tag name (without the leading@
sign)body
- the complete tag body- Returns:
- this comment
-
docRoot
public JDocComment docRoot()
Description copied from interface:JComment
Add the{@docRoot}
tag at this position.- Specified by:
docRoot
in interfaceJComment
- Specified by:
docRoot
in interfaceJDocComment
- Specified by:
docRoot
in interfaceJHtmlComment
- Overrides:
docRoot
in classAbstractJHtmlComment
- Returns:
- this comment
-
p
public JDocComment p()
Description copied from interface:JHtmlComment
Add a paragraph separator.- Specified by:
p
in interfaceJDocComment
- Specified by:
p
in interfaceJHtmlComment
- Overrides:
p
in classAbstractJHtmlComment
- Returns:
- this HTML comment
-
br
public JDocComment br()
Description copied from interface:JHtmlComment
Add a line separator.- Specified by:
br
in interfaceJDocComment
- Specified by:
br
in interfaceJHtmlComment
- Overrides:
br
in classAbstractJHtmlComment
- Returns:
- this HTML comment
-
value
public JDocComment value(JType type, java.lang.String fieldName)
Description copied from interface:JHtmlComment
Add a@value
inline tag.- Specified by:
value
in interfaceJDocComment
- Specified by:
value
in interfaceJHtmlComment
- Overrides:
value
in classAbstractJHtmlComment
- Parameters:
type
- the value typefieldName
- the value field name- Returns:
- this HTML comment
-
docTag
public JHtmlComment docTag(java.lang.String tag)
Description copied from interface:JDocComment
Add a block tag.- Specified by:
docTag
in interfaceJDocComment
- Parameters:
tag
- the tag name- Returns:
- the block tag comment block
-
docTag
public JHtmlComment docTag(java.lang.String tag, java.lang.String firstWord)
Description copied from interface:JDocComment
Add a block tag.- Specified by:
docTag
in interfaceJDocComment
- Parameters:
tag
- the tag namefirstWord
- the tag body first word- Returns:
- the block tag comment block
-
_return
public JHtmlComment _return()
Description copied from interface:JDocComment
Add a@return
tag.- Specified by:
_return
in interfaceJDocComment
- Returns:
- the tag body
-
_throws
public JHtmlComment _throws(JType exceptionType)
Description copied from interface:JDocComment
Add a@throws
tag.- Specified by:
_throws
in interfaceJDocComment
- Parameters:
exceptionType
- the type of exception- Returns:
- the tag body
-
param
public JHtmlComment param(java.lang.String name)
Description copied from interface:JDocComment
Add a@param
tag.- Specified by:
param
in interfaceJDocComment
- Parameters:
name
- the parameter name- Returns:
- the tag body
-
getDocTags
java.util.Map<java.lang.String,java.util.List<DocTagJHtmlComment>> getDocTags()
-
-