Class JavadocUtilizingTrailingSpaceCheck.JavadocLine
java.lang.Object
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocUtilizingTrailingSpaceCheck.JavadocLine
- Enclosing class:
JavadocUtilizingTrailingSpaceCheck
Represents a logical line in a Javadoc comment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DetailNodeThe first node with content on this line, the location of violations.private StringThe first word of the line, used for pull calculations.private booleanWhether the line has content after its leading inline tag.private booleanWhether the line has meaningful content.private intThe length of the line (end column).private final intThe source line number.private booleanWhether skipped lines follow this line, so the next line is not adjacent.private booleanWhether the line starts with a Javadoc block tag.private booleanWhether the line starts with an HTML tag.private booleanWhether the line starts with an inline tag.private booleanWhether the line starts with an unbreakable element (inline tag or URL). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate intReturns the length of the first word on this line.private voidinitContent(String trimmedText, Pattern urlPattern, DetailNode textNode) Initializes content state for the first non-empty text on this line.private booleanChecks whether the only content of this line is a single inline tag, which may exceed the limit.private voidmarkAdditionalContent(String text) Marks the line as having additional content when the given text, which follows the first content of the line, contains a separate word.private voidupdateLength(int startColumn, int contentLength) Updates the line length based on column position and content length.
-
Field Details
-
lineNumber
The source line number. -
firstNode
The first node with content on this line, the location of violations. -
length
The length of the line (end column). -
hasContent
Whether the line has meaningful content. -
startsWithUnbreakable
Whether the line starts with an unbreakable element (inline tag or URL). -
startsWithInlineTag
Whether the line starts with an inline tag. -
hasAdditionalContent
Whether the line has content after its leading inline tag. -
startsWithBlockTag
Whether the line starts with a Javadoc block tag. -
startsWithHtml
Whether the line starts with an HTML tag. -
skippedLinesFollow
Whether skipped lines follow this line, so the next line is not adjacent. -
firstWord
The first word of the line, used for pull calculations.
-
-
Constructor Details
-
JavadocLine
Creates a JavadocLine.- Parameters:
lineNumber- the source line number
-
-
Method Details
-
updateLength
Updates the line length based on column position and content length.- Parameters:
startColumn- the starting column (0-indexed)contentLength- the length of the content
-
initContent
Initializes content state for the first non-empty text on this line.- Parameters:
trimmedText- the trimmed text contenturlPattern- pattern used to detect URLstextNode- the node of the text content
-
markAdditionalContent
Marks the line as having additional content when the given text, which follows the first content of the line, contains a separate word. Text attached to the preceding element, such as trailing punctuation, is not additional content.- Parameters:
text- the text that follows the first content of the line
-
isOnlyInlineTag
Checks whether the only content of this line is a single inline tag, which may exceed the limit.- Returns:
- true if the line contains only an inline tag
-
firstWordLength
Returns the length of the first word on this line.- Returns:
- the first word length
-