Class PatternContentValidator


  • public class PatternContentValidator
    extends ContentValidator
    Pattern content validator.
    • Constructor Detail

      • PatternContentValidator

        public PatternContentValidator​(java.lang.String allowedCharacters,
                                       java.lang.String pattern,
                                       boolean matchSubstring,
                                       PatternGrammar patternGrammar)
        Constructs PatternContentValidator with the given params.
        Parameters:
        allowedCharacters - OCR whitelist. Empty string means no restriction. Default is ""
        pattern - Pattern to match. It can be a simple pattern or a regular expression.
        matchSubstring - Whether the pattern should match the whole string or just a substring. Default is false
        patternGrammar - Grammar of pattern matching. Default is WILDCARD
      • PatternContentValidator

        public PatternContentValidator​(java.lang.String pattern)
        Constructs PatternContentValidator with default parameters.
        Parameters:
        pattern - Pattern to match. It can be a simple pattern or a regular expression.
    • Method Detail

      • getAllowedCharacters

        public java.lang.String getAllowedCharacters()
        Getter for allowedCharacters field. See constructor documentation for more information about the field.
        Returns:
        allowedCharacters
      • setAllowedCharacters

        public void setAllowedCharacters​(java.lang.String allowedCharacters)
        Setter for allowedCharacters field. See constructor documentation for more information about the field.
        Parameters:
        allowedCharacters - Value to set.
      • getPattern

        public java.lang.String getPattern()
        Getter for pattern field. See constructor documentation for more information about the field.
        Returns:
        pattern
      • setPattern

        public void setPattern​(java.lang.String pattern)
        Setter for pattern field. See constructor documentation for more information about the field.
        Parameters:
        pattern - Value to set.
      • getMatchSubstring

        public boolean getMatchSubstring()
        Getter for matchSubstring field. See constructor documentation for more information about the field.
        Returns:
        matchSubstring
      • setMatchSubstring

        public void setMatchSubstring​(boolean matchSubstring)
        Setter for matchSubstring field. See constructor documentation for more information about the field.
        Parameters:
        matchSubstring - Value to set.
      • getPatternGrammar

        public PatternGrammar getPatternGrammar()
        Getter for patternGrammar field. See constructor documentation for more information about the field.
        Returns:
        patternGrammar
      • setPatternGrammar

        public void setPatternGrammar​(PatternGrammar patternGrammar)
        Setter for patternGrammar field. See constructor documentation for more information about the field.
        Parameters:
        patternGrammar - Value to set.