Package org.jboss.jdeparser
Class AbstractJHtmlComment
- java.lang.Object
-
- org.jboss.jdeparser.AbstractJComment
-
- org.jboss.jdeparser.AbstractJHtmlComment
-
- All Implemented Interfaces:
JComment
,JHtmlComment
,Writable
- Direct Known Subclasses:
AbstractJDocComment
,DocTagJHtmlComment
,ImplJHtmlTag
,NestedHtmlCommentContent
abstract class AbstractJHtmlComment extends AbstractJComment implements JHtmlComment
-
-
Field Summary
-
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 AbstractJHtmlComment()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected <T extends HtmlCommentContent>
Tadd(T item)
JHtmlComment
block()
Add a comment sub-block at this location.JHtmlComment
br()
Add a line separator.JHtmlComment
docRoot()
Add the{@docRoot}
tag at this position.JHtmlTag
htmlLink(java.lang.String url)
Add an HTML link (<a>
tag).JHtmlTag
htmlTag(java.lang.String tag, boolean newLine)
Add an HTML tag.JHtmlComment
inlineDocTag(java.lang.String tag, java.lang.String body)
Add an inline doc tag with simple content.JHtmlComment
nl()
Add a newline.JHtmlComment
p()
Add a paragraph separator.JComment
preformattedCode()
Add an inline@code
tag within a<pre></pre>
block.JHtmlComment
sp()
Add a non-trailing space.JHtmlComment
text(java.lang.String text)
Add some text to the end of this comment.JHtmlComment
typeName(JType type)
Add a type name to the end of this comment.JHtmlComment
value(JType type, java.lang.String fieldName)
Add a@value
inline tag.-
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, inlineDocTag, linkConstructor, linkField, linkMethod, linkMethod, linkType
-
-
-
-
Method Detail
-
add
protected <T extends HtmlCommentContent> T add(T item)
-
block
public JHtmlComment 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 interfaceJHtmlComment
- Overrides:
block
in classAbstractJComment
- Returns:
- the comment sub-block
-
sp
public JHtmlComment 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 interfaceJHtmlComment
- Overrides:
sp
in classAbstractJComment
- Returns:
- this comment
-
nl
public JHtmlComment nl()
Description copied from interface:JComment
Add a newline.- Specified by:
nl
in interfaceJComment
- Specified by:
nl
in interfaceJHtmlComment
- Overrides:
nl
in classAbstractJComment
- Returns:
- this comment
-
typeName
public JHtmlComment 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 interfaceJHtmlComment
- Overrides:
typeName
in classAbstractJComment
- Parameters:
type
- the type name to add- Returns:
- this comment
-
text
public JHtmlComment 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 interfaceJHtmlComment
- Overrides:
text
in classAbstractJComment
- Parameters:
text
- the text to add- Returns:
- this comment
-
inlineDocTag
public JHtmlComment 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 interfaceJHtmlComment
- Overrides:
inlineDocTag
in classAbstractJComment
- Parameters:
tag
- the tag name (without the leading@
sign)body
- the complete tag body- Returns:
- this comment
-
docRoot
public JHtmlComment docRoot()
Description copied from interface:JComment
Add the{@docRoot}
tag at this position.- Specified by:
docRoot
in interfaceJComment
- Specified by:
docRoot
in interfaceJHtmlComment
- Overrides:
docRoot
in classAbstractJComment
- Returns:
- this comment
-
p
public JHtmlComment p()
Description copied from interface:JHtmlComment
Add a paragraph separator.- Specified by:
p
in interfaceJHtmlComment
- Returns:
- this HTML comment
-
br
public JHtmlComment br()
Description copied from interface:JHtmlComment
Add a line separator.- Specified by:
br
in interfaceJHtmlComment
- Returns:
- this HTML comment
-
value
public JHtmlComment value(JType type, java.lang.String fieldName)
Description copied from interface:JHtmlComment
Add a@value
inline tag.- Specified by:
value
in interfaceJHtmlComment
- Parameters:
type
- the value typefieldName
- the value field name- Returns:
- this HTML comment
-
htmlLink
public JHtmlTag htmlLink(java.lang.String url)
Description copied from interface:JHtmlComment
Add an HTML link (<a>
tag).- Specified by:
htmlLink
in interfaceJHtmlComment
- Parameters:
url
- the URL to link to- Returns:
- the link tag body
-
htmlTag
public JHtmlTag htmlTag(java.lang.String tag, boolean newLine)
Description copied from interface:JHtmlComment
Add an HTML tag. The given tag should be a valid HTML 4 or 5 tag.- Specified by:
htmlTag
in interfaceJHtmlComment
- Parameters:
tag
- the HTML tagnewLine
-true
to add a newline after the opening tag and before the closing tag- Returns:
- the tag body
-
preformattedCode
public JComment preformattedCode()
Description copied from interface:JHtmlComment
Add an inline@code
tag within a<pre></pre>
block.- Specified by:
preformattedCode
in interfaceJHtmlComment
- Returns:
- the preformatted code block content
-
-