public class TextSearchCriteria extends SearchCriteria
Learn more:
The following example demonstrates how to find and remove watermark using search criteria.
Watermarker watermarker = new Watermarker("C:\\test.some_ext"); SizeSearchCriteria widthRange = new SizeSearchCriteria(Dimension.Width, 50, 100); RotateAngleSearchCriteria rotateAngle = new RotateAngleSearchCriteria(0, 45); TextSearchCriteria textCriteria = new TextSearchCriteria(Pattern.compile("^Test watermark$")); PossibleWatermarkCollection watermarks = watermarker.search(textCriteria.and(widthRange.or(rotateAngle))); watermarks.clear(); watermarker.save("C:\\modified_test.some_ext"); watermarker.close();
Constructor and Description |
---|
TextSearchCriteria(Pattern pattern)
Initializes a new instance of the
class with a specified regular expression. |
TextSearchCriteria(String searchString)
Initializes a new instance of the
class with a search string. |
TextSearchCriteria(String searchString,
boolean isMatchCase)
Initializes a new instance of the
class
with a search string and a flag for comparison. |
Modifier and Type | Method and Description |
---|---|
Pattern |
getPattern()
Gets the search pattern.
|
boolean |
getSkipUnreadableCharacters()
Gets a value indicating that unreadable characters will be skipped during string comparison.
|
void |
setSkipUnreadableCharacters(boolean value)
Sets a value indicating that unreadable characters will be skipped during string comparison.
|
and, not, or
public TextSearchCriteria(Pattern pattern)
TextSearchCriteria
class with a specified regular expression.pattern
- The regular expression to match.public TextSearchCriteria(String searchString, boolean isMatchCase)
TextSearchCriteria
class
with a search string and a flag for comparison.searchString
- The exact string to search for.isMatchCase
- false
to ignore case during the comparison; otherwise, true
.public TextSearchCriteria(String searchString)
TextSearchCriteria
class with a search string.searchString
- The exact string to search for.public final Pattern getPattern()
Gets the search pattern.
public final boolean getSkipUnreadableCharacters()
Gets a value indicating that unreadable characters will be skipped during string comparison.
public final void setSkipUnreadableCharacters(boolean value)
Sets a value indicating that unreadable characters will be skipped during string comparison.
value
- A value indicating that unreadable characters will be skipped during string comparison.