Class PatternContentValidator

java.lang.Object
io.scanbot.sdk.textpattern.ContentValidator
io.scanbot.sdk.textpattern.PatternContentValidator

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

    • PatternContentValidator

      public PatternContentValidator(String allowedCharacters, String pattern, boolean matchSubstring, PatternGrammar patternGrammar)
      Constructs PatternContentValidator with the given params.
      Parameters:
      allowedCharacters - OCR whitelist. Empty string means no restriction. Only characters that are present in the allowedCharacters string will be accepted. For example, if allowedCharacters is set to "ab", the result may only contain characters 'a' and 'b'. 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(String pattern)
      Constructs PatternContentValidator with default parameters.
      Parameters:
      pattern - Pattern to match. It can be a simple pattern or a regular expression.
  • Method Details

    • getAllowedCharacters

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

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

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

      public void setPattern(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.