Class RegexNavigatorBase

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.regex.Pattern pattern  
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexNavigatorBase​(java.util.regex.Pattern pattern)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected NavigationPoint createNavigationPoint​(java.util.regex.Matcher m, java.lang.String sourceText, boolean initialize)
      Called with each match result to create a navigation point based on the match.
      protected void dumpRegexThrowable​(java.lang.Throwable t, java.lang.String text, java.util.regex.Matcher m)
      Logs a description of an exception that occurs during the matching process.
      java.util.List<NavigationPoint> getNavigationPoints​(java.lang.String sourceText)
      Returns a list of navigation points.
      protected void match​(java.lang.String sourceText, java.util.List<NavigationPoint> results)
      Searches the source text for matches of the regular expression, collecting the resulting navigation points.
      • Methods inherited from class java.lang.Object

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

      • pattern

        protected java.util.regex.Pattern pattern
    • Constructor Detail

      • RegexNavigatorBase

        public RegexNavigatorBase​(java.util.regex.Pattern pattern)
    • Method Detail

      • match

        protected void match​(java.lang.String sourceText,
                             java.util.List<NavigationPoint> results)
        Searches the source text for matches of the regular expression, collecting the resulting navigation points.
        Parameters:
        sourceText - the source text to determine navigation points for
        a - list to use to collect extracted points
      • createNavigationPoint

        protected NavigationPoint createNavigationPoint​(java.util.regex.Matcher m,
                                                        java.lang.String sourceText,
                                                        boolean initialize)
        Called with each match result to create a navigation point based on the match. May return null to indicate that no point should be added for the match. The base class returns a simple point based on the text and location of the match.
        Parameters:
        m - the match information
        sourceText - the source text
        initialize - if true, this is the first match of a new pass
        Returns:
        a navigation point for the match, or null
      • dumpRegexThrowable

        protected void dumpRegexThrowable​(java.lang.Throwable t,
                                          java.lang.String text,
                                          java.util.regex.Matcher m)
        Logs a description of an exception that occurs during the matching process.
        Parameters:
        t - the exception that was thrown
        text - the source text being matched against
        m - the matcher that threw t