Class SinglelineDetector


  • class SinglelineDetector
    extends java.lang.Object
    A detector that matches individual lines.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private int currentMatches
      Tracks the number of matches.
      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.
      private DetectorOptions options
      The detection options to use.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void checkLine​(int lineNo, java.lang.String line, java.util.regex.Matcher matcher, int startPosition)
      Check a line for matches.
      private void finish()
      Perform processing at the end of a set of lines.
      void processLines​(java.util.List<java.lang.String> lines)
      Processes a set of lines 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
    • Field Detail

      • MSG_REGEXP_EXCEEDED

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

        public static final java.lang.String MSG_REGEXP_MINIMUM
        A key is pointing to the warning message text in "messages.properties" file.
        See Also:
        Constant Field Values
      • options

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

        private int currentMatches
        Tracks the number of matches.
    • Constructor Detail

      • SinglelineDetector

        SinglelineDetector​(DetectorOptions options)
        Creates an instance.
        Parameters:
        options - the options to use.
    • Method Detail

      • processLines

        public void processLines​(java.util.List<java.lang.String> lines)
        Processes a set of lines looking for matches.
        Parameters:
        lines - the lines to process.
      • finish

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

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

        private void checkLine​(int lineNo,
                               java.lang.String line,
                               java.util.regex.Matcher matcher,
                               int startPosition)
        Check a line for matches.
        Parameters:
        lineNo - the line number of the line to check
        line - the line to check
        matcher - the matcher to use
        startPosition - the position to start searching from.