com.pdfunit.validators

## Class BarcodeValidator

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

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

  This class provides several functions to read text from bar codes and QR code images.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 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` | `BarcodeValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages, ImageRegion imageRegion, ImageValidator backreference)`
    `protected` | `BarcodeValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages, ImageValidator backreference)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `BarcodeValidator` | `containing(java.lang.String expectedText)` This method checks that the value of the given paramter is part of the extracted text of each extracted images.
    `BarcodeValidator` | `containing(java.lang.String expectedText, WhitespaceProcessing whitespaceProcessing)` This method checks that the value of the given paramter is part of the extracted text of an image.
    `BarcodeValidator` | `endingWith(java.lang.String endString)` This method checks that the extracted text of an image ends with the value of the given parameter.
    `BarcodeValidator` | `equalsTo(java.lang.String expectedText)` This method checks that the extracted text of an image is the same as the value of the given parameter.
    `BarcodeValidator` | `equalsTo(java.lang.String expectedText, WhitespaceProcessing whitespaceProcessing)` This method checks that the extracted text of an image is the same as the value of the given parameter.
    `void` | `matchingImage(java.io.File expectedImageFile)` This method compares an expected image (given by the file) with previously extracted images of a PDF document.
    `void` | `matchingImage(java.io.InputStream expectedImageStream)` This method compares an expected image (given by the stream) with previously extracted images of a PDF document.
    `void` | `matchingImage(java.lang.String expectedImageFilename)` This method compares an expected image (given by the file name) with previously extracted images of a PDF document.
    `void` | `matchingImage(java.net.URL expectedImageURL)` This method compares an expected image (given by the URL) with previously extracted images of a PDF document.
    `BarcodeValidator` | `matchingRegex(java.lang.String regex)` This method evaluates the extracted text of an image with the given regular expression.
    `BarcodeValidator` | `startingWith(java.lang.String startString)` This method checks that the extracted text of an image starts with the value of the given parameter.

    - ### 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

    - #### BarcodeValidator

          protected BarcodeValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages,
                          ImageValidator backreference)

    - #### BarcodeValidator

          protected BarcodeValidator(java.util.Collection<com.pdfunit.internal.spi.IImage> extractedImagesAllPages,
                          ImageRegion imageRegion,
                          ImageValidator backreference)

  - ### Method Detail

    - #### containing

          @Guarded
          public BarcodeValidator containing(java.lang.String expectedText)

      This method checks that the value of the given paramter is part of the extracted text of each extracted images. Whitespaces will be ignored.

    - #### containing

          @Guarded
          public BarcodeValidator containing(java.lang.String expectedText,
                                            WhitespaceProcessing whitespaceProcessing)

      This method checks that the value of the given paramter is part of the extracted text of an image. The given whitespace processing will be respected.

    - #### endingWith

          @Guarded
          public BarcodeValidator endingWith(java.lang.String endString)

      This method checks that the extracted text of an image ends with the value of the given parameter. Whitespaces are taken as they are.

    - #### equalsTo

          @Guarded
          public BarcodeValidator equalsTo(java.lang.String expectedText)

      This method checks that the extracted text of an image is the same as the value of the given parameter. Whitespaces will be normalized.

    - #### equalsTo

          @Guarded
          public BarcodeValidator equalsTo(java.lang.String expectedText,
                                          WhitespaceProcessing whitespaceProcessing)

      This method checks that the extracted text of an image is the same as the value of the given parameter. The given whitespace processing will be respected.

    - #### matchingImage

          @Guarded
          public void matchingImage(java.lang.String expectedImageFilename)

      This method compares an expected image (given by the file name) with previously extracted images of a PDF document.

    - #### matchingImage

          @Guarded
          public void matchingImage(java.io.File expectedImageFile)

      This method compares an expected image (given by the file) with previously extracted images of a PDF document.

    - #### matchingImage

          @Guarded
          public void matchingImage(java.net.URL expectedImageURL)

      This method compares an expected image (given by the URL) with previously extracted images of a PDF document.

    - #### matchingImage

          @Guarded
          public void matchingImage(java.io.InputStream expectedImageStream)

      This method compares an expected image (given by the stream) with previously extracted images of a PDF document.

    - #### matchingRegex

          @Guarded
          public BarcodeValidator matchingRegex(java.lang.String regex)

      This method evaluates the extracted text of an image with the given regular expression.

    - #### startingWith

          @Guarded
          public BarcodeValidator startingWith(java.lang.String startString)

      This method checks that the extracted text of an image starts with the value of the given parameter. Whitespaces are taken as they are.

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