Class MultilineDetector

java.lang.Object
com.puppycrawl.tools.checkstyle.checks.regexp.MultilineDetector

class MultilineDetector extends Object
A detector that matches across multiple lines.
  • Field Details

    • MSG_REGEXP_EXCEEDED

      public static final String MSG_REGEXP_EXCEEDED
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • MSG_REGEXP_MINIMUM

      public static final String MSG_REGEXP_MINIMUM
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • MSG_EMPTY

      public static final String MSG_EMPTY
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • MSG_STACKOVERFLOW

      public static final String MSG_STACKOVERFLOW
      A key is pointing to the warning message text in "messages.properties" file.
      See Also:
    • options

      private final DetectorOptions options
      The detection options to use.
    • currentMatches

      private int currentMatches
      Tracks the number of matches.
    • matcher

      private Matcher matcher
      The matcher.
    • text

      private FileText text
      The file text content.
  • Constructor Details

    • MultilineDetector

      MultilineDetector(DetectorOptions options)
      Creates an instance.
      Parameters:
      options - the options to use.
  • Method Details

    • processLines

      public void processLines(FileText fileText)
      Processes an entire text file looking for matches.
      Parameters:
      fileText - the text to process
    • findMatch

      private void findMatch()
      Method that finds the matches.
    • finish

      private void finish()
      Perform processing at the end of a set of lines.
    • resetState

      private void resetState()
      Reset the state of the detector.