com.pdfunit.validators

## Class PageValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.AbstractPageValidator
    - - com.pdfunit.validators.PageValidator

-     @DoNotObfuscate
      public final class PageValidator
      extends com.pdfunit.validators.AbstractPageValidator

  The main entry class to all validators.

  This validator provides all 'first' methods of the fluent API. The methods mostly return instances of other validators

  Since:
    2016.05
  Author:
    Carsten Siedentop, February 2016

- - ### Field Summary

    - ### Fields inherited from class com.pdfunit.validators.AbstractPageValidator

      `effectedPageNumbers, pageScanFlag, pagesToUse, region`

    - ### Fields inherited from class com.pdfunit.validators.AbstractValidator

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `PageValidator(DocumentValidator documentValidator)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `RenderedPageValidator` | `asRenderedPage()` This method prepares the validation of PDF pages as rendered images.
    `void` | `containsImage(java.awt.image.BufferedImage expectedImage)`
    `void` | `containsOneImageOf(java.awt.image.BufferedImage[] allPossibleImages)`
    `SingleFieldValidator` | `hasField(java.lang.String fieldName)` This method does what the name suggests.
    `void` | `hasFields(java.lang.String... fieldNames)`
    `PageValidator` | `hasFormat(DocumentFormat expectedFormat)` This method verifies the format against every page of a document.
    `ImageValidator` | `hasImage()` This method checks that images exist on every effected pages.
    `DocumentValidator` | `hasNoImage()`
    `DocumentValidator` | `hasNoText()`
    `PageValidator` | `hasNumberOfDifferentImages(int expectedNumber)` This method compares the number of different images of a PDF document with the number, given by the parameter.
    `PageValidator` | `hasNumberOfVisibleImages(int expectedNumber)` This method checks the number of visible images of a PDF document with the expected sum, given by the 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.
    `TextValidator` | `hasText()` This method prepares the validation of text for the previously defined pages and regions.
    `DocumentValidator` | `isSignedBy(java.lang.String expectedSignatory)`
    `PageValidator` | `restrictedTo(PageRegion region)` This method sets a region filter for the following validation process.

    - ### Methods inherited from class com.pdfunit.validators.AbstractPageValidator

      `createFullSizeRegionFromDocument, getEffectedPages, getPageScanFlag, setPagesToUse, setRegion`

    - ### Methods inherited from class com.pdfunit.validators.AbstractValidator

      `closeDocument, equals, getDocument, hashCode`

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

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

- - ### Constructor Detail

    - #### PageValidator

          protected PageValidator(DocumentValidator documentValidator)

  - ### Method Detail

    - #### asRenderedPage

          public RenderedPageValidator asRenderedPage()

      This method prepares the validation of PDF pages as rendered images.

    - #### containsImage

          @Guarded
          public void containsImage(java.awt.image.BufferedImage expectedImage)

    - #### containsOneImageOf

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

    - #### hasField

          @Guarded
          public SingleFieldValidator hasField(java.lang.String fieldName)

      This method does what the name suggests.

    - #### hasFields

          @Guarded
          public void hasFields(java.lang.String... fieldNames)

    - #### hasFormat

          @Guarded
          public PageValidator hasFormat(DocumentFormat expectedFormat)

      This method verifies the format against every page of a document.

    - #### hasImage

          public ImageValidator hasImage()

      This method checks that images exist on every effected pages.

    - #### hasNoText

          public DocumentValidator hasNoText()

    - #### hasNoImage

          public DocumentValidator hasNoImage()

    - #### hasNumberOfDifferentImages

          @Guarded
          public PageValidator hasNumberOfDifferentImages(int expectedNumber)

      This method compares the number of different images of a PDF document with the number, given by the parameter.

    - #### hasNumberOfVisibleImages

          @Guarded
          public PageValidator hasNumberOfVisibleImages(int expectedNumber)

      This method checks the number of visible images of a PDF document with the expected sum, given by the parameter.

      Images like logo's that appear on different pages of the document are counted multiple times.

    - #### hasSignatureField

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

      This method checks that a signature field with the given name exists.

    - #### hasSignatureFields

          public AllSignaturesValidator hasSignatureFields()

      This method verifies that a document has at least one signature field and prepares all signature fields for further checks.

    - #### hasText

          public TextValidator hasText()

      This method prepares the validation of text for the previously defined pages and regions.

    - #### isSignedBy

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

    - #### restrictedTo

          @Guarded
          public PageValidator restrictedTo(PageRegion region)

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

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