@DoNotObfuscate
public final class DocumentValidator
extends com.pdfunit.validators.AbstractPageValidator
This validator provides all 'first' methods of the fluent API. The methods mostly return instances of other validators
Constructor and Description |
---|
DocumentValidator(com.pdfunit.internal.spi.IDocument testDocument)
This constructor is the entry to all tests.
|
Modifier and Type | Method and Description |
---|---|
CompareDocumentValidator |
and(byte[] byteArrayMaster)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(byte[] byteArrayMaster,
java.lang.String password)
This method creates an instance of a validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.io.File fileMaster)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.io.InputStream fisMaster)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.io.InputStream fisMaster,
java.lang.String password)
This method creates an instance of a validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.lang.String filenameMaster)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.lang.String compareFilename,
java.lang.String password)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.net.URL urlMaster)
This method creates an instance of an validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
CompareDocumentValidator |
and(java.net.URL urlMaster,
java.lang.String password)
This method creates an instance of a validator, which provides many methods,
to compare a test-PDF with a master-PDF.
|
RenderedPageValidator |
asRenderedPage(PagesToUse pagesToUse)
Deprecated.
|
CompliesWithValidator |
compliesWith() |
DocumentValidator |
containsImage(java.io.File imageFile,
PagesToUse pagesToUse)
Deprecated.
|
DocumentValidator |
containsImage(java.io.InputStream imageStream,
PagesToUse pagesToUse)
Deprecated.
|
DocumentValidator |
containsImage(java.lang.String imageFileName,
PagesToUse pagesToUse)
Deprecated.
|
DocumentValidator |
containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages)
This method verifies that one of the given images is present on the previously defined pages.
|
DocumentValidator |
containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages,
PagesToUse pagesToUse)
Deprecated.
|
PropertyValidator |
hasAuthor()
This method does what the name suggests.
|
BookmarkDetailsValidator |
hasBookmark()
This method verifies that a PDF document has one or more bookmarks.
|
AllBookmarksValidator |
hasBookmarks()
This method verifies that a PDF document has one ore more bookmarks.
|
DateValidator |
hasCreationDate()
This method returns a validator which provides validation methods for dates.
|
PropertyValidator |
hasCreator()
This method returns a validator which provides validation methods for the document creator.
|
EmbeddedFileValidator |
hasEmbeddedFile()
This method returns a validator which provides validation methods for embedded files.
|
DocumentValidator |
hasEncryptionLength(int expectedEncryptionLength)
This method does what the name suggests.
|
SingleFieldValidator |
hasField(java.lang.String fieldname)
This method does what the name suggests.
|
AllFieldsValidator |
hasFields()
This method does what the name suggests.
|
void |
hasFields(java.lang.String... fieldNames) |
FontNameValidator |
hasFont()
This method prepares the validation for one font.
|
AllFontsValidator |
hasFonts()
This method verifies that the current PDF document has fonts.
|
DocumentValidator |
hasFormat(DocumentFormat expectedFormat)
This method verifies the format against every page of a document.
|
DocumentValidator |
hasFormat(DocumentFormat expectedFormat,
PagesToUse pagesToUse)
Deprecated.
|
ImageValidator |
hasImage()
This method checks that images exist on every effected pages.
|
ImageValidator |
hasImage(PagesToUse pagesToUse)
Deprecated.
|
ImageValidator |
hasImage(PagesToUse pagesToUse,
PageRegion region)
Deprecated.
|
JavaScriptValidator |
hasJavaScript()
This method verifies that the current PDF document has document level JavaScript.
|
JavaScriptActionValidator |
hasJavaScriptAction() |
PropertyValidator |
hasKeywords()
This method verifies the existence of keywords.
|
DocumentValidator |
hasLanguageInfo(java.util.Locale expectedLocale)
This method does what the name suggests.
|
DocumentValidator |
hasLanguageInfo(java.lang.String expectedLocale)
This method checks the expected language and country information against
the data of the PDF document.
|
LayerNameValidator |
hasLayer()
This method verifies whether a PDF document uses layers.
|
AllLayersValidator |
hasLayers()
This method does what the name suggests.
|
DocumentValidator |
hasLessPagesThan(int maximumNumberExclusive)
This method does what the name suggests.
|
GotoLocalActionValidator |
hasLocalGotoAction()
This method does what the name suggests.
|
DateValidator |
hasModificationDate()
This method does what the name suggests.
|
DocumentValidator |
hasMorePagesThan(int minimumNumberExclusive)
This method does what the name suggests.
|
NamedDestinationValidator |
hasNamedDestination()
This method does what the name suggests.
|
DocumentValidator |
hasNoAuthor()
This method does what the name suggests.
|
DocumentValidator |
hasNoCreationDate()
This method does what the name suggests.
|
DocumentValidator |
hasNoCreator()
This method does what the name suggests.
|
DocumentValidator |
hasNoImage() |
DocumentValidator |
hasNoKeywords()
This method does what the name suggests.
|
DocumentValidator |
hasNoLanguageInfo()
This method does what the name suggests.
|
DocumentValidator |
hasNoModificationDate()
This method does what the name suggests.
|
DocumentValidator |
hasNoProducer()
This method does what the name suggests.
|
DocumentValidator |
hasNoProperty(java.lang.String key)
This method verifies that the current PDF document does not have
the property with the key equals to the given parameter.
|
DocumentValidator |
hasNoSubject()
This method does what the name suggests.
|
void |
hasNoText() |
void |
hasNoText(PagesToUse pagesToUse)
Deprecated.
|
void |
hasNoText(PagesToUse pagesToUse,
PageRegion region)
Deprecated.
|
DocumentValidator |
hasNoTitle()
This method does what the name suggests.
|
DocumentValidator |
hasNoXFAData() |
DocumentValidator |
hasNoXMPData() |
DocumentValidator |
hasNumberOfActions(int expectedNumber) |
DocumentValidator |
hasNumberOfBookmarks(int expectedNumber)
This method does what the name suggests.
|
DocumentValidator |
hasNumberOfDifferentImages(int expectedNumber)
This method compares the number of different images of a PDF document
with the number, given by the parameter.
|
DocumentValidator |
hasNumberOfDifferentImages(int expectedNumber,
PagesToUse pagesToUse)
Deprecated.
|
DocumentValidator |
hasNumberOfDifferentImages(int expectedNumber,
PagesToUse pagesToUse,
PageRegion region)
Deprecated.
|
DocumentValidator |
hasNumberOfEmbeddedFiles(int expectedNumber)
This method does what the name suggests.
|
DocumentValidator |
hasNumberOfFields(int expectedNumber)
This method does what the name suggests.
|
DocumentValidator |
hasNumberOfFonts(int expectedNumber,
IdentifiedBy filter)
This method does what the name suggests.
|
DocumentValidator |
hasNumberOfLayers(int expectedNumber)
This method returns the number of layers (optional content groups).
|
DocumentValidator |
hasNumberOfOCGs(int expectedNumber)
The function is identical with hasNumberOfLayers().
|
DocumentValidator |
hasNumberOfPages(int expectedNumber)
This method does what the name suggests.
|
DocumentValidator |
hasNumberOfSignatures(int expectedNumber)
This method verifies the given number of expected signatures.
|
DocumentValidator |
hasNumberOfVisibleImages(int expectedNumber)
This method checks the number of visible images of a PDF document
with the expected sum, given by the parameter.
|
DocumentValidator |
hasNumberOfVisibleImages(int expectedNumber,
PagesToUse pagesToUse)
Deprecated.
|
DocumentValidator |
hasNumberOfVisibleImages(int expectedNumber,
PagesToUse pagesToUse,
PageRegion region)
Deprecated.
|
LayerNameValidator |
hasOCG()
This method verifies whether a PDF document uses layers.
|
AllLayersValidator |
hasOCGs()
This method verifies whether a PDF document uses layers.
|
DocumentValidator |
hasOwnerPassword(java.lang.String expectedPassword)
This method checks that the current document can be opened with the password given
by the parameter.
|
PermissionValidator |
hasPermission()
This method prepares the validation of permissions of the current PDF documents.
|
PropertyValidator |
hasProducer()
This method does what the name suggests.
|
PropertyValidator |
hasProperty(java.lang.String key)
This method verifies that the current PDF document has a property with
the key equals to the given parameter.
|
SignatureFieldValidator |
hasSignatureField(java.lang.String fieldName)
This method checks that a signature field with the given name exists.
|
AllSignaturesValidator |
hasSignatureFields()
This method verifies that a document has at least one signature field
and prepares all signature fields for further checks.
|
PropertyValidator |
hasSubject()
This method does what the name suggests.
|
TextValidator |
hasText()
This method prepares the validation of text for the previously defined pages and regions.
|
TextValidator |
hasText(PagesToUse pagesToUse)
Deprecated.
|
TextValidator |
hasText(PagesToUse pagesToUse,
PageRegion region)
Deprecated.
|
PropertyValidator |
hasTitle()
This method does what the name suggests.
|
DocumentValidator |
hasUserPassword(java.lang.String expectedPassword)
This method checks that the current document can be opened with the password given
by the parameter.
|
VersionValidator |
hasVersion()
This method does what the name suggests.
|
XFAValidator |
hasXFAData() |
XMPValidator |
hasXMPData() |
ZugferdValidator |
hasZugferdData() |
DocumentValidator |
isCertified()
Verifying that a PDF is certified.
|
DocumentValidator |
isCertifiedFor(CertificationLevel expectedCertificationLevel)
Verifying that the certification level of the current PDF document is equal to the
expected certification level.
|
DocumentValidator |
isLinearizedForFastWebView() |
DocumentValidator |
isSigned()
This method does what the name suggests.
|
DocumentValidator |
isSignedBy(java.lang.String expectedSignatory) |
TaggingValidator |
isTagged() |
PageValidator |
restrictedTo(PagesToUse pagesToUse)
This method sets a page filter for the following validation process.
|
createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion
public DocumentValidator(com.pdfunit.internal.spi.IDocument testDocument)
@Guarded public CompareDocumentValidator and(java.lang.String filenameMaster)
@Guarded public CompareDocumentValidator and(java.io.File fileMaster)
@Guarded public CompareDocumentValidator and(java.io.InputStream fisMaster)
@Guarded public CompareDocumentValidator and(java.net.URL urlMaster)
@Guarded public CompareDocumentValidator and(byte[] byteArrayMaster)
@Guarded public CompareDocumentValidator and(java.lang.String compareFilename, java.lang.String password)
@Guarded public CompareDocumentValidator and(java.io.InputStream fisMaster, java.lang.String password)
@Guarded public CompareDocumentValidator and(java.net.URL urlMaster, java.lang.String password)
@Guarded public CompareDocumentValidator and(byte[] byteArrayMaster, java.lang.String password)
@Deprecated @Guarded public RenderedPageValidator asRenderedPage(PagesToUse pagesToUse)
Instead of AssertThat.document(filename).asRenderedPage(pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).asRenderedPage()
.
public CompliesWithValidator compliesWith()
@Deprecated @Guarded public DocumentValidator containsImage(java.io.File imageFile, PagesToUse pagesToUse)
Instead of AssertThat.document(filename).containsImage(imageFile, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasImage().matching(imageFile)
.
@Deprecated @Guarded public DocumentValidator containsImage(java.lang.String imageFileName, PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).containsImage(imageFile, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasImage().matching(imageFile)
.
@Deprecated @Guarded public DocumentValidator containsImage(java.io.InputStream imageStream, PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).containsImage(imageFile, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasImage().matching(imageFile)
.
@Guarded public DocumentValidator containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages)
@Deprecated @Guarded public DocumentValidator containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages, PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).containsOneImageOf(..)
use AssertThat.document(filename).restrictedTo(pagesToUse).containsOneImageOf(..)
.
public PropertyValidator hasAuthor()
public BookmarkDetailsValidator hasBookmark()
public AllBookmarksValidator hasBookmarks()
public DateValidator hasCreationDate()
public PropertyValidator hasCreator()
public EmbeddedFileValidator hasEmbeddedFile()
public DocumentValidator hasEncryptionLength(int expectedEncryptionLength)
@Guarded public SingleFieldValidator hasField(java.lang.String fieldname)
public AllFieldsValidator hasFields()
@Guarded public void hasFields(java.lang.String... fieldNames)
public FontNameValidator hasFont()
public AllFontsValidator hasFonts()
@Guarded public DocumentValidator hasFormat(DocumentFormat expectedFormat)
@Deprecated @Guarded public DocumentValidator hasFormat(DocumentFormat expectedFormat, PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasFormat(format, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasFormat(format)
.
@Guarded public ImageValidator hasImage()
@Deprecated @Guarded public ImageValidator hasImage(PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasImage(pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasImage()
.
@Deprecated @Guarded public ImageValidator hasImage(PagesToUse pagesToUse, PageRegion region)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasImage(pagesToUse, region)
use AssertThat.document(filename).restrictedTo(pagesToUse).restrictedTo(region).hasImage()
.
public JavaScriptValidator hasJavaScript()
To check whether a JavaScript function belongs to an action, use
hasJavaScriptAction()
public JavaScriptActionValidator hasJavaScriptAction()
public PropertyValidator hasKeywords()
The term in plural is intended, because it is a term inside PDF documents.
@Guarded public DocumentValidator hasLanguageInfo(java.lang.String expectedLocale)
This method works 'not case sensitive'.
expectedLocale
- "de-DE" oder "de_DE"hasLanguageInfo(Locale)
@Guarded public DocumentValidator hasLanguageInfo(java.util.Locale expectedLocale)
hasLanguageInfo(String)
public LayerNameValidator hasLayer()
public AllLayersValidator hasLayers()
@Guarded public DocumentValidator hasLessPagesThan(int maximumNumberExclusive)
public GotoLocalActionValidator hasLocalGotoAction()
public DateValidator hasModificationDate()
@Guarded public DocumentValidator hasMorePagesThan(int minimumNumberExclusive)
public NamedDestinationValidator hasNamedDestination()
public DocumentValidator hasNoAuthor()
public DocumentValidator hasNoCreationDate()
public DocumentValidator hasNoCreator()
public DocumentValidator hasNoImage()
public DocumentValidator hasNoLanguageInfo()
public DocumentValidator hasNoKeywords()
public DocumentValidator hasNoModificationDate()
public DocumentValidator hasNoProducer()
@Guarded public DocumentValidator hasNoProperty(java.lang.String key)
public DocumentValidator hasNoSubject()
@Guarded public void hasNoText()
@Deprecated @Guarded public void hasNoText(PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNoText(pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasNoText()
.
@Deprecated @Guarded public void hasNoText(PagesToUse pagesToUse, PageRegion region)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNoText(pagesToUse, region)
use AssertThat.document(filename).restrictedTo(pagesToUse).restrictedTo(region).hasNoText()
.
public DocumentValidator hasNoTitle()
public DocumentValidator hasNoXFAData()
public DocumentValidator hasNoXMPData()
@Guarded public DocumentValidator hasNumberOfActions(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfBookmarks(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfDifferentImages(int expectedNumber)
@Deprecated @Guarded public DocumentValidator hasNumberOfDifferentImages(int expectedNumber, PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNumberOfDifferentImages(nr, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasNumberOfDifferentImages(nr)
.
@Deprecated @Guarded public DocumentValidator hasNumberOfDifferentImages(int expectedNumber, PagesToUse pagesToUse, PageRegion region)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNumberOfDifferentImages(nr, pagesToUse, region)
use AssertThat.document(filename).restrictedTo(pagesToUse).restrictedTo(region).hasNumberOfDifferentImages(nr)
.
@Guarded public DocumentValidator hasNumberOfEmbeddedFiles(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfFields(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfFonts(int expectedNumber, IdentifiedBy filter)
@Guarded public DocumentValidator hasNumberOfLayers(int expectedNumber)
hasNumberOfOCGs(int)
.@Guarded public DocumentValidator hasNumberOfOCGs(int expectedNumber)
hasNumberOfLayers(int)
@Guarded public DocumentValidator hasNumberOfPages(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfSignatures(int expectedNumber)
@Guarded public DocumentValidator hasNumberOfVisibleImages(int expectedNumber)
Images like logo's that appear on different pages of the document are counted multiple times.
@Deprecated @Guarded public DocumentValidator hasNumberOfVisibleImages(int expectedNumber, PagesToUse pagesToUse)
Images like logo's which appear on different pages of the document are counted multiple times.
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNumberOfVisibleImages(nr, pagesToUse)
use AssertThat.document(filename).restrictedTo(pagesToUse).hasNumberOfVisibleImages(nr)
.
@Deprecated @Guarded public DocumentValidator hasNumberOfVisibleImages(int expectedNumber, PagesToUse pagesToUse, PageRegion region)
This method is deprecated because the style of the fluent API changed.
Instead of AssertThat.document(filename).hasNumberOfVisibleImages(nr, pagesToUse, region)
use AssertThat.document(filename).restrictedTo(pagesToUse).restrictedTo(region).hasNumberOfVisibleImages(nr)
.
public LayerNameValidator hasOCG()
public AllLayersValidator hasOCGs()
hasLayers()
@Guarded public DocumentValidator hasOwnerPassword(java.lang.String expectedPassword)
public PermissionValidator hasPermission()
public PropertyValidator hasProducer()
@Guarded public PropertyValidator hasProperty(java.lang.String key)
@Guarded public SignatureFieldValidator hasSignatureField(java.lang.String fieldName)
public AllSignaturesValidator hasSignatureFields()
public PropertyValidator hasSubject()
public TextValidator hasText()
@Deprecated @Guarded public TextValidator hasText(PagesToUse pagesToUse)
This method is deprecated because the style of the fluent API changed. Use AssertThat.document(..).restrictedTo(PagesToUse).hasText() instead of this method.
@Deprecated @Guarded public TextValidator hasText(PagesToUse pagesToUse, PageRegion region)
This method is deprecated because the style of the fluent API changed. Use AssertThat.document(..).restrictedTo(PagesToUse).restrictedTo(PageRegionUpperLeftBased).hasText() instead of this method.
public PropertyValidator hasTitle()
@Guarded public DocumentValidator hasUserPassword(java.lang.String expectedPassword)
public VersionValidator hasVersion()
public XFAValidator hasXFAData()
public XMPValidator hasXMPData()
public ZugferdValidator hasZugferdData()
public DocumentValidator isCertified()
@Guarded public DocumentValidator isCertifiedFor(CertificationLevel expectedCertificationLevel)
public DocumentValidator isLinearizedForFastWebView()
public DocumentValidator isSigned()
public DocumentValidator isSignedBy(java.lang.String expectedSignatory)
public TaggingValidator isTagged()
@Guarded public PageValidator restrictedTo(PagesToUse pagesToUse)
Copyright (C) PDFUnit.com. See here for license.