Class HtmlTag
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.javadoc.HtmlTag
Used to keep track of a tag and the text that follows it.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final boolean
If this tag is self-closed.private final String
The HTML tag name.private final boolean
If the tag is incomplete.private final int
The line number in the source file where this tag was found.private static final int
The maximum length of text to display with this tag.private final int
The position within the line where this tag was found.private final String
The comment line of text where this tag appears. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetId()
Returns the id (name) of this tag.int
Returns the source line number where this tag was found.int
Returns the position with in the comment line where this tag was found.getText()
Returns the comment line of text where this tag appears.boolean
Indicates if this tag is a self-closed XHTML style.boolean
Indicates if this tag is a close (end) tag.boolean
Indicates if this tag is incomplete (has no close >).toString()
-
Field Details
-
MAX_TEXT_LEN
The maximum length of text to display with this tag.- See Also:
-
id
The HTML tag name. -
lineNo
The line number in the source file where this tag was found. -
position
The position within the line where this tag was found. -
text
The comment line of text where this tag appears. -
closedTag
If this tag is self-closed. -
incompleteTag
If the tag is incomplete.
-
-
Constructor Details
-
HtmlTag
Construct the HtmlTag.- Parameters:
id
- the HTML tag name.lineNo
- the source line number of this tag.position
- the position within the text of this tag.closedTag
- if this tag is self-closed (XHTML style)incomplete
- is the tag is incomplete.text
- the line of comment text for this tag.
-
-
Method Details
-
getId
Returns the id (name) of this tag.- Returns:
- a String id.
-
isCloseTag
Indicates if this tag is a close (end) tag.- Returns:
true
is this is a close tag.
-
isClosedTag
Indicates if this tag is a self-closed XHTML style.- Returns:
true
is this is a self-closed tag.
-
isIncompleteTag
Indicates if this tag is incomplete (has no close >).- Returns:
true
if the tag is incomplete.
-
getLineNo
Returns the source line number where this tag was found. Used for displaying a Checkstyle violation.- Returns:
- an int line number.
-
getPosition
Returns the position with in the comment line where this tag was found. Used for displaying a Checkstyle violation.- Returns:
- an int relative to zero.
-
toString
-
getText
Returns the comment line of text where this tag appears.- Returns:
- text of the tag
-