com.pdfunit.validators

## Class SingleFieldJavaScriptValidator

- java.lang.Object
- - com.pdfunit.validators.AbstractValidator
  - - com.pdfunit.validators.SingleFieldJavaScriptValidator

-     @DoNotObfuscate
      public final class SingleFieldJavaScriptValidator
      extends com.pdfunit.validators.AbstractValidator

  Validator for JavaScript that is associated to a form field.
  Since:
    2016.05
  Author:
    Carsten Siedentop, January 2016

- - ### Field Summary

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

      `testDocument`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `SingleFieldJavaScriptValidator(SingleFieldValidator backReference, com.pdfunit.internal.spi.IField currentField)` Creating a validator for a JavaScript that is associated to a field of an PDF formular.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `SingleFieldJavaScriptValidator` | `containing(java.lang.String expectedScript)` This method checks that the expected string is part of one of the existing JavaScript snippets that are associated to the current field.
    `SingleFieldValidator` | `hasField(java.lang.String expectedFieldName)` Verify that a field with the given name exists.

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

    - #### SingleFieldJavaScriptValidator

          protected SingleFieldJavaScriptValidator(SingleFieldValidator backReference,
                                        com.pdfunit.internal.spi.IField currentField)

      Creating a validator for a JavaScript that is associated to a field of an PDF formular.

  - ### Method Detail

    - #### containing

          @Guarded
          public SingleFieldJavaScriptValidator containing(java.lang.String expectedScript)

      This method checks that the expected string is part of one of the existing JavaScript snippets that are associated to the current field.

    - #### hasField

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

      Verify that a field with the given name exists. When a field is found, it is kept statefully for further validations. Otherwise an exception is thrown.

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