Class HtmlTag
- java.lang.Object
-
- com.puppycrawl.tools.checkstyle.checks.javadoc.HtmlTag
-
class HtmlTag extends java.lang.Object
Used to keep track of a tag and the text that follows it.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanclosedTagIf this tag is self-closed.private java.lang.StringidThe HTML tag name.private booleanincompleteTagIf the tag is incomplete.private intlineNoThe line number in the source file where this tag was found.private static intMAX_TEXT_LENThe maximum length of text to display with this tag.private intpositionThe position within the line where this tag was found.private java.lang.StringtextThe comment line of text where this tag appears.
-
Constructor Summary
Constructors Constructor Description HtmlTag(java.lang.String id, int lineNo, int position, boolean closedTag, boolean incomplete, java.lang.String text)Construct the HtmlTag.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetId()Returns the id (name) of this tag.intgetLineNo()Returns the source line number where this tag was found.intgetPosition()Returns the position with in the comment line where this tag was found.java.lang.StringgetText()Returns the comment line of text where this tag appears.booleanisClosedTag()Indicates if this tag is a self-closed XHTML style.booleanisCloseTag()Indicates if this tag is a close (end) tag.booleanisIncompleteTag()Indicates if this tag is incomplete (has no close >).java.lang.StringtoString()
-
-
-
Field Detail
-
MAX_TEXT_LEN
private static final int MAX_TEXT_LEN
The maximum length of text to display with this tag.- See Also:
- Constant Field Values
-
id
private final java.lang.String id
The HTML tag name.
-
lineNo
private final int lineNo
The line number in the source file where this tag was found.
-
position
private final int position
The position within the line where this tag was found.
-
text
private final java.lang.String text
The comment line of text where this tag appears.
-
closedTag
private final boolean closedTag
If this tag is self-closed.
-
incompleteTag
private final boolean incompleteTag
If the tag is incomplete.
-
-
Constructor Detail
-
HtmlTag
HtmlTag(java.lang.String id, int lineNo, int position, boolean closedTag, boolean incomplete, java.lang.String text)
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 Detail
-
getId
public java.lang.String getId()
Returns the id (name) of this tag.- Returns:
- a String id.
-
isCloseTag
public boolean isCloseTag()
Indicates if this tag is a close (end) tag.- Returns:
trueis this is a close tag.
-
isClosedTag
public boolean isClosedTag()
Indicates if this tag is a self-closed XHTML style.- Returns:
trueis this is a self-closed tag.
-
isIncompleteTag
public boolean isIncompleteTag()
Indicates if this tag is incomplete (has no close >).- Returns:
trueif the tag is incomplete.
-
getLineNo
public int getLineNo()
Returns the source line number where this tag was found. Used for displaying a Checkstyle violation.- Returns:
- an int line number.
-
getPosition
public int 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
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getText
public java.lang.String getText()
Returns the comment line of text where this tag appears.- Returns:
- text of the tag
-
-