Class JavadocUtilizingTrailingSpaceCheck.JavadocLine

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.javadoc.JavadocUtilizingTrailingSpaceCheck.JavadocLine
Enclosing class:
JavadocUtilizingTrailingSpaceCheck

private static final class JavadocUtilizingTrailingSpaceCheck.JavadocLine extends Object
Represents a logical line in a Javadoc comment.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private DetailNode
    The first node with content on this line, the location of violations.
    private String
    The first word of the line, used for pull calculations.
    private boolean
    Whether the line has content after its leading inline tag.
    private boolean
    Whether the line has meaningful content.
    private int
    The length of the line (end column).
    private final int
    The source line number.
    private boolean
    Whether skipped lines follow this line, so the next line is not adjacent.
    private boolean
    Whether the line starts with a Javadoc block tag.
    private boolean
    Whether the line starts with an HTML tag.
    private boolean
    Whether the line starts with an inline tag.
    private boolean
    Whether the line starts with an unbreakable element (inline tag or URL).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    JavadocLine(int lineNumber)
    Creates a JavadocLine.
  • Method Summary

    Modifier and Type
    Method
    Description
    private int
    Returns the length of the first word on this line.
    private void
    initContent(String trimmedText, Pattern urlPattern, DetailNode textNode)
    Initializes content state for the first non-empty text on this line.
    private boolean
    Checks whether the only content of this line is a single inline tag, which may exceed the limit.
    private void
    Marks the line as having additional content when the given text, which follows the first content of the line, contains a separate word.
    private void
    updateLength(int startColumn, int contentLength)
    Updates the line length based on column position and content length.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • lineNumber

      private final int lineNumber
      The source line number.
    • firstNode

      The first node with content on this line, the location of violations.
    • length

      private int length
      The length of the line (end column).
    • hasContent

      private boolean hasContent
      Whether the line has meaningful content.
    • startsWithUnbreakable

      private boolean startsWithUnbreakable
      Whether the line starts with an unbreakable element (inline tag or URL).
    • startsWithInlineTag

      private boolean startsWithInlineTag
      Whether the line starts with an inline tag.
    • hasAdditionalContent

      private boolean hasAdditionalContent
      Whether the line has content after its leading inline tag.
    • startsWithBlockTag

      private boolean startsWithBlockTag
      Whether the line starts with a Javadoc block tag.
    • startsWithHtml

      private boolean startsWithHtml
      Whether the line starts with an HTML tag.
    • skippedLinesFollow

      private boolean skippedLinesFollow
      Whether skipped lines follow this line, so the next line is not adjacent.
    • firstWord

      private String firstWord
      The first word of the line, used for pull calculations.
  • Constructor Details

    • JavadocLine

      private JavadocLine(int lineNumber)
      Creates a JavadocLine.
      Parameters:
      lineNumber - the source line number
  • Method Details

    • updateLength

      private void updateLength(int startColumn, int contentLength)
      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

      private void initContent(String trimmedText, Pattern urlPattern, DetailNode textNode)
      Initializes content state for the first non-empty text on this line.
      Parameters:
      trimmedText - the trimmed text content
      urlPattern - pattern used to detect URLs
      textNode - the node of the text content
    • markAdditionalContent

      private void markAdditionalContent(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. 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

      private boolean 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

      private int firstWordLength()
      Returns the length of the first word on this line.
      Returns:
      the first word length