Package io.scanbot.sdk.textpattern
Class PatternContentValidator
java.lang.Object
io.scanbot.sdk.textpattern.ContentValidator
io.scanbot.sdk.textpattern.PatternContentValidator
Pattern content validator.
-
Constructor Summary
ConstructorsConstructorDescriptionPatternContentValidator(String pattern) Constructs PatternContentValidator with default parameters.PatternContentValidator(String allowedCharacters, String pattern, boolean matchSubstring, PatternGrammar patternGrammar) Constructs PatternContentValidator with the given params. -
Method Summary
Modifier and TypeMethodDescriptionGetter for allowedCharacters field.booleanGetter for matchSubstring field.Getter for pattern field.Getter for patternGrammar field.voidsetAllowedCharacters(String allowedCharacters) Setter for allowedCharacters field.voidsetMatchSubstring(boolean matchSubstring) Setter for matchSubstring field.voidsetPattern(String pattern) Setter for pattern field.voidsetPatternGrammar(PatternGrammar patternGrammar) Setter for patternGrammar field.
-
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
Constructs PatternContentValidator with default parameters.- Parameters:
pattern- Pattern to match. It can be a simple pattern or a regular expression.
-
-
Method Details
-
getAllowedCharacters
Getter for allowedCharacters field. See constructor documentation for more information about the field.- Returns:
- allowedCharacters
-
setAllowedCharacters
Setter for allowedCharacters field. See constructor documentation for more information about the field.- Parameters:
allowedCharacters- Value to set.
-
getPattern
Getter for pattern field. See constructor documentation for more information about the field.- Returns:
- pattern
-
setPattern
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
Getter for patternGrammar field. See constructor documentation for more information about the field.- Returns:
- patternGrammar
-
setPatternGrammar
Setter for patternGrammar field. See constructor documentation for more information about the field.- Parameters:
patternGrammar- Value to set.
-