Class MultilineDetector


  • class MultilineDetector
    extends java.lang.Object
    A detector that matches across multiple lines.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int currentMatches
      Tracks the number of matches.
      private java.util.regex.Matcher matcher
      The matcher.
      static java.lang.String MSG_EMPTY
      A key is pointing to the warning message text in "messages.properties" file.
      static java.lang.String MSG_REGEXP_EXCEEDED
      A key is pointing to the warning message text in "messages.properties" file.
      static java.lang.String MSG_REGEXP_MINIMUM
      A key is pointing to the warning message text in "messages.properties" file.
      static java.lang.String MSG_STACKOVERFLOW
      A key is pointing to the warning message text in "messages.properties" file.
      private DetectorOptions options
      The detection options to use.
      private FileText text
      The file text content.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void findMatch()
      Method that finds the matches.
      private void finish()
      Perform processing at the end of a set of lines.
      void processLines​(FileText fileText)
      Processes an entire text file looking for matches.
      private void resetState()
      Reset the state of the detector.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • 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.