Class RegexMatch


  • public class RegexMatch
    extends java.lang.Object
    Represents information about a regular expression match.
    • Constructor Summary

      Constructors 
      Constructor Description
      RegexMatch​(PatternInfo patternInfo, java.lang.String location, boolean isContentMatch, java.lang.String value, java.lang.String valueContext, int matchStart, int matchEnd)
      Creates a new instance
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getExpression()
      Convenience method for obtaining the regular expression string from the associated PatternInfo object.
      java.lang.String getLocation()
      Gets the location of match such as content or metdata property name.
      long getMatchEnd()
      Gets the offset in source text where match ends
      long getMatchStart()
      Gets the offset in source text where match starts
      PatternInfo getPatternInfo()
      Gets the associated PatternInfo object which made the match.
      java.lang.String getValue()
      Gets the matched value
      java.lang.String getValueContext()
      Gets contextual string of match if one was provided
      boolean isContentMatch()
      Gets whether this match was made in the content text of an item.
      • Methods inherited from class java.lang.Object

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

      • RegexMatch

        public RegexMatch​(PatternInfo patternInfo,
                          java.lang.String location,
                          boolean isContentMatch,
                          java.lang.String value,
                          java.lang.String valueContext,
                          int matchStart,
                          int matchEnd)
        Creates a new instance
        Parameters:
        patternInfo - The pattern which made the match
        location - Where the match was made (content or metadata property name)
        isContentMatch - True if the match was made on item content text
        value - The matched value
        valueContext - Contextual text around match
        matchStart - Offset in source text where match starts
        matchEnd - Offset in source text where match ends
    • Method Detail

      • getExpression

        public java.lang.String getExpression()
        Convenience method for obtaining the regular expression string from the associated PatternInfo object.
        Returns:
        The regular expression string from the associated PatternInfo object
      • getPatternInfo

        public PatternInfo getPatternInfo()
        Gets the associated PatternInfo object which made the match.
        Returns:
        The associated PatternInfo object which made the match
      • getLocation

        public java.lang.String getLocation()
        Gets the location of match such as content or metdata property name.
        Returns:
        The location of match such as content or metdata property name
      • isContentMatch

        public boolean isContentMatch()
        Gets whether this match was made in the content text of an item.
        Returns:
        True if this match was made in the content text of an item.
      • getValue

        public java.lang.String getValue()
        Gets the matched value
        Returns:
        The matched value
      • getMatchStart

        public long getMatchStart()
        Gets the offset in source text where match starts
        Returns:
        The offset in source text where match starts
      • getMatchEnd

        public long getMatchEnd()
        Gets the offset in source text where match ends
        Returns:
        The offset in source text where match ends
      • getValueContext

        public java.lang.String getValueContext()
        Gets contextual string of match if one was provided
        Returns:
        The context string of match if one was provided