Class MultilineDetector

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

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

    • options

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

      private final String exceededMessage
      The message key for exceeded matches.
    • minimumMessage

      private final String minimumMessage
      The message key for minimum matches not met.
    • emptyMessage

      private final String emptyMessage
      The message key for empty format.
    • stackOverflowMessage

      private final String stackOverflowMessage
      The message key for StackOverflow error.
    • 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, String exceededMessage, String minimumMessage, String emptyMessage, String stackOverflowMessage)
      Creates an instance.
      Parameters:
      options - the options to use.
      exceededMessage - the message key for exceeded matches.
      minimumMessage - the message key for minimum matches not met.
      emptyMessage - the message key for empty format.
      stackOverflowMessage - the message key for StackOverflow error.
  • 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.