@DoNotObfuscate
public final class TextValidator
extends com.pdfunit.validators.AbstractPageValidator
Modifier | Constructor and Description |
---|---|
protected |
TextValidator(DocumentValidator documentValidator) |
Modifier and Type | Method and Description |
---|---|
TextValidator |
containing(java.lang.String... expectedTokens)
This method verifies that the text on every page in effect contains all given arguments.
|
TextValidator |
containing(java.lang.String expectedToken)
This method verifies that the text on every page in effect contains the given argument.
|
TextValidator |
containing(java.lang.String[] expectedTokens,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page, which is selected by the test,
contains all given arguments.
|
TextValidator |
containing(java.lang.String expectedToken,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect contains given arguments.
|
TextValidator |
containingZugferdData(XMLNode node)
This method verifies that the text of previously defined pages and regions
contains that text, which is extracted from the ZUGFeRD data from that
node, which is defined by the given parameter.
|
TextValidator |
endingWith(java.lang.String expectedEnd)
This method verifies that the text on every page in effect ends with the given parameter.
|
TextValidator |
endingWith(java.lang.String expectedEnd,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect ends with the given parameter.
|
TextValidator |
equalsTo(java.lang.String expected)
This method verifies that the text on every page in effect is equals to
the expected value.
|
TextValidator |
equalsTo(java.lang.String expected,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect is equals to the expected value.
|
OrderedTextValidator |
first(java.lang.String expectedToken)
This methods checks that the actual text contains the expected token.
|
OrderedTextValidator |
first(java.lang.String expectedToken,
WhitespaceProcessing whitespaceProcessing)
This methods checks that the actual text contains the expected token.
|
protected java.lang.String |
getFilteredText(int pageNumber)
This method is invoked by other validator classes.
|
boolean |
hasNoText()
This method ensures that the previously selected pages or regions do not contain text.
|
TextValidator |
hasText()
This method verifies that the previously selected pages or regions contain text.
|
TextValidator |
inOrder(java.lang.String... expectedTokens)
This method verifies, that the existing text of the current PDF document
contains all the expected tokens in order.
|
TextValidator |
inOrder(WhitespaceProcessing whitespaceProcessing,
java.lang.String... expectedTokens)
This method verifies, that the existing text of the current PDF document
contains all the expected tokens in order.
|
TextValidator |
matchingComplete(java.lang.String expected)
Deprecated.
|
TextValidator |
matchingComplete(java.lang.String expected,
WhitespaceProcessing whitespaceProcessing)
Deprecated.
|
TextValidator |
matchingRegex(java.lang.String regex)
This method verifies that the text on every page in effect matches the regular
expression given by the parameter.
|
TextValidator |
notContaining(java.lang.String... notExpectedTokens)
This method verifies that the text on every page in effect does not contain the
string given by the parameter.
|
TextValidator |
notContaining(java.lang.String notExpectedToken)
This method verifies that the text on every page in effect does not contain the
string given by the parameter.
|
TextValidator |
notContaining(java.lang.String[] notExpectedTokens,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect does not contain the
string given by the parameter.
|
TextValidator |
notContaining(java.lang.String notExpectedToken,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect does not contain the
string given by the parameter.
|
TextValidator |
notEndingWith(java.lang.String notExpectedEnd)
This method verifies that the text on every page in effect does not end with the given parameter.
|
TextValidator |
notMatchingRegex(java.lang.String regex)
This method verifies that the text on every page in effect does not match
the regular expression given by the parameter.
|
TextValidator |
notStartingWith(java.lang.String notExpectedStart)
This method verifies that the text on every page in effect does not start
with the given parameter.
|
TextValidator |
startingWith(java.lang.String expectedStart)
This method verifies that the text on every page in effect starts with the given parameter.
|
TextValidator |
startingWith(java.lang.String expectedStart,
WhitespaceProcessing whitespaceProcessing)
This method verifies that the text on every page in effect starts with the given parameter.
|
createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion
protected TextValidator(DocumentValidator documentValidator)
@Guarded public TextValidator containing(java.lang.String expectedToken)
@Guarded public TextValidator containing(java.lang.String expectedToken, WhitespaceProcessing whitespaceProcessing)
@Guarded public TextValidator containing(java.lang.String... expectedTokens)
@Guarded public TextValidator containing(java.lang.String[] expectedTokens, WhitespaceProcessing whitespaceProcessing)
@Guarded public TextValidator containingZugferdData(XMLNode node)
All whitespaces will be ignored.
@Guarded public OrderedTextValidator first(java.lang.String expectedToken)
Whitespace of the existing text and of the expected text will be normalized.
@Guarded public OrderedTextValidator first(java.lang.String expectedToken, WhitespaceProcessing whitespaceProcessing)
Whitespace of the existing text and of the expected text will be processed according to the second parameter.
@Guarded public TextValidator endingWith(java.lang.String expectedEnd)
@Guarded public TextValidator endingWith(java.lang.String expectedEnd, WhitespaceProcessing whitespaceProcessing)
@Guarded public TextValidator equalsTo(java.lang.String expected)
@Guarded public TextValidator equalsTo(java.lang.String expected, WhitespaceProcessing whitespaceProcessing)
protected java.lang.String getFilteredText(int pageNumber)
public boolean hasNoText()
If the flag 'pageScanFlag' is set, only one page has to have no text.
It's recommended, not to use negated methods in combination with AnyPageBefore
, AnyPageAfter
, AnyPage
,
or PagesFromTo
. The logic is difficult.
public TextValidator hasText()
If the flag 'PageScan.MATCH_ON_ANY_PAGE' is set, only one page has to have text.
PageScan
@Guarded public TextValidator inOrder(java.lang.String... expectedTokens)
This method can not be invoked with an empty array, because empty arrays will be rejected by the guard.
@Guarded public TextValidator inOrder(WhitespaceProcessing whitespaceProcessing, java.lang.String... expectedTokens)
This method can not be invoked with an empty array, because empty arrays will be rejected by the guard.
@Deprecated @Guarded public TextValidator matchingComplete(java.lang.String expected)
The method is deprecated, use 'equalsTo()' instead. Both methods have the same behaviour but the new name is closer to the natural language.
Whitespaces are stripped before.@Guarded @Deprecated public TextValidator matchingComplete(java.lang.String expected, WhitespaceProcessing whitespaceProcessing)
The method is deprecated, use 'equalsTo()' instead. Both methods have the same behaviour but the new name is closer to the natural language.
WhitespaceProcessing
@Guarded public TextValidator matchingRegex(java.lang.String regex)
@Guarded public TextValidator notContaining(java.lang.String notExpectedToken)
@Guarded public TextValidator notContaining(java.lang.String... notExpectedTokens)
@Guarded public TextValidator notContaining(java.lang.String notExpectedToken, WhitespaceProcessing whitespaceProcessing)
WhitespaceProcessing
@Guarded public TextValidator notContaining(java.lang.String[] notExpectedTokens, WhitespaceProcessing whitespaceProcessing)
WhitespaceProcessing
@Guarded public TextValidator notEndingWith(java.lang.String notExpectedEnd)
@Guarded public TextValidator notMatchingRegex(java.lang.String regex)
@Guarded public TextValidator notStartingWith(java.lang.String notExpectedStart)
@Guarded public TextValidator startingWith(java.lang.String expectedStart)
@Guarded public TextValidator startingWith(java.lang.String expectedStart, WhitespaceProcessing whitespaceProcessing)
Copyright (C) PDFUnit.com. See here for license.