com.pdfunit.validators

## Class MultiDocumentValidator

- java.lang.Object
- - com.pdfunit.validators.MultiDocumentValidator

-     @DoNotObfuscate
      public final class MultiDocumentValidator
      extends java.lang.Object

  This class provides validation methods for a collection of PDF documents.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 2016
  See Also:
    `DocumentValidator`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MultiDocumentValidator(java.util.Vector<DocumentValidator> validatorCollection)` This constructor is the entry to all tests belonging to a set of PDF documents.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `MultiDocumentCompliesWithValidator` | `compliesWith()`
    `MultiDocumentValidator` | `containsImage(java.io.File imageFile, PagesToUse pagesToUse)` Deprecated.
    `MultiDocumentValidator` | `containsImage(java.io.InputStream imageStream, PagesToUse pagesToUse)` Deprecated.
    `MultiDocumentValidator` | `containsImage(java.lang.String imageFileName, PagesToUse pagesToUse)` Deprecated.
    `MultiDocumentValidator` | `containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages)`
    `MultiDocumentValidator` | `containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages, PagesToUse pagesToUse)` Deprecated.
    `java.util.Vector<DocumentValidator>` | `getValdiatorCollection()`
    `MultiDocumentPropertyValidator` | `hasAuthor()` This method checks that each document of the given set of PDF documents has an author.
    `MultiDocumentBookmarkDetailsValidator` | `hasBookmark()` This method verifies that each given PDF document has one or more bookmarks.
    `MultiDocumentBookmarkValidator` | `hasBookmarks()` This method verifies that each given PDF document has one ore more bookmarks.
    `MultiDocumentValidator` | `hasEncryptionLength(int expectedEncryptionLength)` This method verifies that each document of the given set of PDF documents is encrypted with the expected key length.
    `MultiDocumentSingleFieldValidator` | `hasField(java.lang.String fieldname)` This method verifies that each document of the given set of PDF documents has a field with the expected name.
    `MultiDocumentAllFieldsValidator` | `hasFields()` This method checks that each given PDF has fields.
    `MultiDocumentFontNameValidator` | `hasFont()` This method prepares the validation for one font in each given PDF document.
    `MultiDocumentFontValidator` | `hasFonts()` This method verifies that each given PDF document has fonts.
    `MultiDocumentFormatValidator` | `hasFormat(DocumentFormat expectedFormat)` This method checks that each document of the given set of PDF documents has the expected page format.
    `MultiDocumentValidator` | `hasFormat(DocumentFormat expectedFormat, PagesToUse pagesToUse)` Deprecated.
    `MultiDocumentImageValidator` | `hasImage()`
    `void` | `hasImage(PagesToUse pagesToUse)` Deprecated.
    `void` | `hasImage(PagesToUse pagesToUse, PageRegion region)` Deprecated.
    `MultiDocumentJavaScriptValidator` | `hasJavaScript()` This method verifies that each given PDF document has embedded JavaScript.
    `MultiDocumentPropertyValidator` | `hasKeywords()` This method checks that each document of the given set of PDF documents has a keywords.
    `MultiDocumentValidator` | `hasLanguageInfo(java.util.Locale expectedLocale)` This method verifies that each document of the given set of PDF documents has the expected locale.
    `MultiDocumentValidator` | `hasLanguageInfo(java.lang.String expectedLocale)` This method verifies that each document of the given set of PDF documents has the expected locale.
    `MultiDocumentValidator` | `hasNoAuthor()` This method verifies that each document of the given set of PDF documents does not have an author information.
    `MultiDocumentValidator` | `hasNoImage()` This method checks, that each document of the given set of PDF documents do not have text on the given pages.
    `MultiDocumentValidator` | `hasNoKeywords()` This method verifies that each document of the given set of PDF documents does not have keywords.
    `MultiDocumentValidator` | `hasNoLanguageInfo()` This method verifies that each document of the given set of PDF documents does not contain a locale.
    `MultiDocumentValidator` | `hasNoProperty(java.lang.String key)` This method verifies that each document of the given set of PDF documents does not have a property with the given key.
    `MultiDocumentValidator` | `hasNoSubject()` This method verifies that each document of the given set of PDF documents does not have a subject.
    `MultiDocumentValidator` | `hasNoText()` This method checks, that each document of the given set of PDF documents do not have text on the given pages.
    `MultiDocumentValidator` | `hasNoTitle()` This method verifies that each document of the given set of PDF documents does not have a title.
    `MultiDocumentValidator` | `hasNoXFAData()` Validating that each document of the given set of PDF documents does not have XFA data.
    `MultiDocumentValidator` | `hasNoXMPData()` Validating that each document of the given set of PDF documents does not have XMP data.
    `MultiDocumentValidator` | `hasNumberOfBookmarks(int expectedNumber)` This method checks that each given PDF documents has the expected number of bookmarks.
    `MultiDocumentValidator` | `hasNumberOfDifferentImages(int expectedNumber)`
    `MultiDocumentValidator` | `hasNumberOfFields(int expectedNumber)` This method verifies that each given PDF document has the expected number of fields.
    `MultiDocumentValidator` | `hasNumberOfFonts(int expectedNumber, IdentifiedBy filter)` This method checks the number of fonts in each given PDF document.
    `MultiDocumentValidator` | `hasNumberOfSignatures(int expectedNumber)` This method verifies that each document of the given set of PDF documents has the expected number of signatures.
    `MultiDocumentValidator` | `hasNumberOfVisibleImages(int expectedNumber)`
    `void` | `hasOwnerPassword(java.lang.String expectedPassword)` This method checks that each given PDF document can be opened with the password given by the parameter.
    `MultiDocumentPermissionValidator` | `hasPermission()` This method prepares the validation of permissions of the current PDF documents.
    `MultiDocumentPropertyValidator` | `hasProperty(java.lang.String key)` This method checks that each document of the given set of PDF documents has the expected key.
    `MultiDocumentSignatureFieldValidator` | `hasSignatureField(java.lang.String fieldName)`
    `MultiAllSignaturesValidator` | `hasSignatureFields()`
    `MultiDocumentPropertyValidator` | `hasSubject()` This method checks that each document of the given set of PDF documents has a subject.
    `MultiDocumentTextValidator` | `hasText()`
    `MultiDocumentTextValidator` | `hasText(PagesToUse pagesToUse, PageRegion region)` Deprecated.
    `MultiDocumentPropertyValidator` | `hasTitle()` This method checks that each document of the given set of PDF documents has a title.
    `void` | `hasUserPassword(java.lang.String expectedPassword)` This method checks that each given PDF document can be opened with the password given by the parameter.
    `MultiDocumentVersionValidator` | `hasVersion()` This method checks that each documents of the given set of PDF documents has a version.
    `MultiDocumentXFAValidator` | `hasXFAData()` Validating that each document of the given set of PDF documents has XFA data.
    `MultiDocumentXMPValidator` | `hasXMPData()` Validating that each document of the given set of PDF documents has XMP data.
    `MultiDocumentZugferdValidator` | `hasZugferdData()`
    `MultiDocumentValidator` | `isCertified()` This method verifies that each document of the given set of PDF documents is certified.
    `MultiDocumentValidator` | `isCertifiedFor(CertificationLevel expectedCertificationLevel)` This method verifies that each document of the given set of PDF documents is certified for the expected level.
    `MultiDocumentValidator` | `isLinearizedForFastWebView()`
    `MultiDocumentValidator` | `isSigned()` This method verifies that each document of the given set of PDF documents is signed.
    `MultiDocumentValidator` | `isSignedBy(java.lang.String expectedSignatory)`
    `MultiDocumentTaggingValidator` | `isTagged()`
    `MultiDocumentValidator` | `passedFilter(FilenameFilter filenameFilter)` This methods excludes all files from the following test, whose names matches the regular expression inside the given filename filter.
    `MultiDocumentValidator` | `restrictedTo(PageRegion region)` This method sets a region filter for the following validation process.
    `MultiDocumentValidator` | `restrictedTo(PagesToUse pagesToUse)` This method sets a page filter for the following validation process.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MultiDocumentValidator

          public MultiDocumentValidator(java.util.Vector<DocumentValidator> validatorCollection)

      This constructor is the entry to all tests belonging to a set of PDF documents.

  - ### Method Detail

    - #### getValdiatorCollection

          public java.util.Vector<DocumentValidator> getValdiatorCollection()

    - #### compliesWith

          public MultiDocumentCompliesWithValidator compliesWith()

    - #### containsImage

          @Deprecated
          @Guarded
          public MultiDocumentValidator containsImage(java.lang.String imageFileName,
                                                                PagesToUse pagesToUse)

      Deprecated.
      This method verifies that the given image is present on every page, defined by the second parameter. This was done for each given PDF document.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).containsImage(imageName, pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasImage().matching(imageName)`.

    - #### containsImage

          @Deprecated
          @Guarded
          public MultiDocumentValidator containsImage(java.io.File imageFile,
                                                                PagesToUse pagesToUse)

      Deprecated.
      This method verifies that the given image is present on every page, defined by the second parameter. This was done for each given PDF document.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).containsImage(imageFile, pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasImage().matching(imageFile)`.

    - #### containsImage

          @Deprecated
          @Guarded
          public MultiDocumentValidator containsImage(java.io.InputStream imageStream,
                                                                PagesToUse pagesToUse)

      Deprecated.
      This method verifies that the given image is present on every page, defined by the second parameter. This was done for each given PDF document.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).containsImage(imageStream, pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasImage().matching(imageStream)`.

    - #### containsOneImageOf

          @Guarded
          public MultiDocumentValidator containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages)

    - #### containsOneImageOf

          @Deprecated
          @Guarded
          public MultiDocumentValidator containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages,
                                                                     PagesToUse pagesToUse)

      Deprecated.
      This method verifies that one of the given images is present on the pages that are defined by the second parameter. This was done for each given PDF document.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).containsOneImageOf(images, pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasImage().matchingOneOf(images)`.

    - #### passedFilter

          @Guarded
          public MultiDocumentValidator passedFilter(FilenameFilter filenameFilter)

      This methods excludes all files from the following test, whose names matches the regular expression inside the given filename filter.

    - #### hasAuthor

          public MultiDocumentPropertyValidator hasAuthor()

      This method checks that each document of the given set of PDF documents has an author.

    - #### hasBookmark

          public MultiDocumentBookmarkDetailsValidator hasBookmark()

      This method verifies that each given PDF document has one or more bookmarks. It returns a validator class, which provides more methods to validate a single bookmark.

    - #### hasBookmarks

          public MultiDocumentBookmarkValidator hasBookmarks()

      This method verifies that each given PDF document has one ore more bookmarks. It returns a validator class that provides XML-based validation methods.

    - #### hasEncryptionLength

          @Guarded
          public MultiDocumentValidator hasEncryptionLength(int expectedEncryptionLength)

      This method verifies that each document of the given set of PDF documents is encrypted with the expected key length.

    - #### hasField

          @Guarded
          public MultiDocumentSingleFieldValidator hasField(java.lang.String fieldname)

      This method verifies that each document of the given set of PDF documents has a field with the expected name.

    - #### hasFields

          public MultiDocumentAllFieldsValidator hasFields()

      This method checks that each given PDF has fields.

      When the form does not contain any field, an instance of PDFUnitValidationException will be thrown.

    - #### hasFont

          public MultiDocumentFontNameValidator hasFont()

      This method prepares the validation for one font in each given PDF document.

    - #### hasFonts

          public MultiDocumentFontValidator hasFonts()

      This method verifies that each given PDF document has fonts.

    - #### hasFormat

          @Guarded
          public MultiDocumentFormatValidator hasFormat(DocumentFormat expectedFormat)

      This method checks that each document of the given set of PDF documents has the expected page format.

    - #### hasFormat

          @Deprecated
          @Guarded
          public MultiDocumentValidator hasFormat(DocumentFormat expectedFormat,
                                                            PagesToUse pagesToUse)

      Deprecated.
      This method checks that each document of the given set of PDF documents has the expected page format on that pages that are defined by the second parameter.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).hasFormat(format, pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasFormat(format)`.

    - #### hasJavaScript

          public MultiDocumentJavaScriptValidator hasJavaScript()

      This method verifies that each given PDF document has embedded JavaScript.

      To check whether a JavaScript function belongs to an action, see `JavaScriptActionValidator`

      See Also:
        `JavaScriptActionValidator`

    - #### hasImage

          public MultiDocumentImageValidator hasImage()

    - #### hasImage

          @Deprecated
          @Guarded
          public void hasImage(PagesToUse pagesToUse)

      Deprecated.
      This method validates that the current document has an image in the defined pages. This method is needed for ongoing tests which are pointing to the image itself.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).hasImage(pagesToUse)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).hasImage()`.

    - #### hasImage

          @Deprecated
          @Guarded
          public void hasImage(PagesToUse pagesToUse,
                                         PageRegion region)

      Deprecated.
      This method validates that the current document has an image in the defined pages and regions. This method is needed for ongoing tests which are pointing to the image itself.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).hasImage(pagesToUse, region)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).restrictedTo(region).hasImage()`.

    - #### hasNoImage

          public MultiDocumentValidator hasNoImage()

      This method checks, that each document of the given set of PDF documents do not have text on the given pages.

      An exceptions is thrown, when text was found.

    - #### hasKeywords

          public MultiDocumentPropertyValidator hasKeywords()

      This method checks that each document of the given set of PDF documents has a keywords.

    - #### hasLanguageInfo

          @Guarded
          public MultiDocumentValidator hasLanguageInfo(java.lang.String expectedLocale)

      This method verifies that each document of the given set of PDF documents has the expected locale.

    - #### hasLanguageInfo

          @Guarded
          public MultiDocumentValidator hasLanguageInfo(java.util.Locale expectedLocale)

      This method verifies that each document of the given set of PDF documents has the expected locale.

    - #### hasNoAuthor

          public MultiDocumentValidator hasNoAuthor()

      This method verifies that each document of the given set of PDF documents does not have an author information.

    - #### hasNoKeywords

          public MultiDocumentValidator hasNoKeywords()

      This method verifies that each document of the given set of PDF documents does not have keywords.

    - #### hasNoLanguageInfo

          public MultiDocumentValidator hasNoLanguageInfo()

      This method verifies that each document of the given set of PDF documents does not contain a locale.

    - #### hasNoProperty

          @Guarded
          public MultiDocumentValidator hasNoProperty(java.lang.String key)

      This method verifies that each document of the given set of PDF documents does not have a property with the given key.

    - #### hasNoSubject

          public MultiDocumentValidator hasNoSubject()

      This method verifies that each document of the given set of PDF documents does not have a subject.

    - #### hasNoText

          public MultiDocumentValidator hasNoText()

      This method checks, that each document of the given set of PDF documents do not have text on the given pages.

      An exceptions is thrown, when text was found.

    - #### hasNoTitle

          public MultiDocumentValidator hasNoTitle()

      This method verifies that each document of the given set of PDF documents does not have a title.

    - #### hasNoXFAData

          public MultiDocumentValidator hasNoXFAData()

      Validating that each document of the given set of PDF documents does not have XFA data.

    - #### hasNoXMPData

          public MultiDocumentValidator hasNoXMPData()

      Validating that each document of the given set of PDF documents does not have XMP data.

      It makes sense to return void, because there are no data to analyze further.

    - #### hasNumberOfBookmarks

          @Guarded
          public MultiDocumentValidator hasNumberOfBookmarks(int expectedNumber)

      This method checks that each given PDF documents has the expected number of bookmarks.

    - #### hasNumberOfDifferentImages

          @Guarded
          public MultiDocumentValidator hasNumberOfDifferentImages(int expectedNumber)

    - #### hasNumberOfFields

          @Guarded
          public MultiDocumentValidator hasNumberOfFields(int expectedNumber)

      This method verifies that each given PDF document has the expected number of fields.

    - #### hasNumberOfFonts

          @Guarded
          public MultiDocumentValidator hasNumberOfFonts(int expectedNumber,
                                                        IdentifiedBy filter)

      This method checks the number of fonts in each given PDF document.

    - #### hasNumberOfSignatures

          @Guarded
          public MultiDocumentValidator hasNumberOfSignatures(int expectedNumber)

      This method verifies that each document of the given set of PDF documents has the expected number of signatures.

    - #### hasNumberOfVisibleImages

          @Guarded
          public MultiDocumentValidator hasNumberOfVisibleImages(int expectedNumber)

    - #### hasOwnerPassword

          @Guarded
          public void hasOwnerPassword(java.lang.String expectedPassword)

      This method checks that each given PDF document can be opened with the password given by the parameter. When this method is invoked with an user password, the method throws a PDFUnitValidationException.

    - #### hasPermission

          public MultiDocumentPermissionValidator hasPermission()

      This method prepares the validation of permissions of the current PDF documents.

    - #### hasProperty

          @Guarded
          public MultiDocumentPropertyValidator hasProperty(java.lang.String key)

      This method checks that each document of the given set of PDF documents has the expected key.

    - #### hasSignatureField

          @Guarded
          public MultiDocumentSignatureFieldValidator hasSignatureField(java.lang.String fieldName)

    - #### hasSignatureFields

          public MultiAllSignaturesValidator hasSignatureFields()

    - #### hasSubject

          public MultiDocumentPropertyValidator hasSubject()

      This method checks that each document of the given set of PDF documents has a subject.

    - #### hasText

          public MultiDocumentTextValidator hasText()

    - #### hasText

          @Deprecated
          @Guarded
          public MultiDocumentTextValidator hasText(PagesToUse pagesToUse,
                                                              PageRegion region)

      Deprecated.
      This method checks that each document of the given set of PDF documents contains text on the pages that are defined by the parameter.

      This method is deprecated because the style of the fluent API changed. Instead of `AssertThat.eachDocument(filenames).hasText(pagesToUse, region)` use `AssertThat.eachDocument(filenames).restrictedTo(pagesToUse).restrictedTo(region).hasText()`.

    - #### hasTitle

          public MultiDocumentPropertyValidator hasTitle()

      This method checks that each document of the given set of PDF documents has a title.

    - #### hasUserPassword

          @Guarded
          public void hasUserPassword(java.lang.String expectedPassword)

      This method checks that each given PDF document can be opened with the password given by the parameter. When this method is invoked with an owner password, the method throws a PDFUnitValidationException.

    - #### hasVersion

          public MultiDocumentVersionValidator hasVersion()

      This method checks that each documents of the given set of PDF documents has a version.

    - #### hasXFAData

          public MultiDocumentXFAValidator hasXFAData()

      Validating that each document of the given set of PDF documents has XFA data.

    - #### hasXMPData

          public MultiDocumentXMPValidator hasXMPData()

      Validating that each document of the given set of PDF documents has XMP data.

    - #### hasZugferdData

          public MultiDocumentZugferdValidator hasZugferdData()

    - #### isCertified

          public MultiDocumentValidator isCertified()

      This method verifies that each document of the given set of PDF documents is certified.

    - #### isCertifiedFor

          @Guarded
          public MultiDocumentValidator isCertifiedFor(CertificationLevel expectedCertificationLevel)

      This method verifies that each document of the given set of PDF documents is certified for the expected level.

    - #### isLinearizedForFastWebView

          public MultiDocumentValidator isLinearizedForFastWebView()

    - #### isSigned

          public MultiDocumentValidator isSigned()

      This method verifies that each document of the given set of PDF documents is signed.

    - #### isSignedBy

          @Guarded
          public MultiDocumentValidator isSignedBy(java.lang.String expectedSignatory)

    - #### isTagged

          public MultiDocumentTaggingValidator isTagged()

    - #### restrictedTo

          @Guarded
          public MultiDocumentValidator restrictedTo(PagesToUse pagesToUse)

      This method sets a page filter for the following validation process.

    - #### restrictedTo

          @Guarded
          public MultiDocumentValidator restrictedTo(PageRegion region)

      This method sets a region filter for the following validation process.

Copyright (C) PDFUnit.com. See here for license.