org.apache.pdfbox.preflight.process

## Class AcroFormValidationProcess

- java.lang.Object
- - org.apache.pdfbox.preflight.process.AbstractProcess
  - - org.apache.pdfbox.preflight.process.AcroFormValidationProcess

All Implemented Interfaces:
  ValidationProcess

    public class AcroFormValidationProcess
    extends AbstractProcess

### Constructor Summary

Constructors
Constructor and Description
`AcroFormValidationProcess()`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected void` `checkNeedAppearences(PreflightContext ctx, org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm acroForm)` This method checks if the NeedAppearances entry is present.
`protected boolean` `exploreFields(PreflightContext ctx, List<org.apache.pdfbox.pdmodel.interactive.form.PDField> fields)` This function explores all fields and their children to validate them.
`protected boolean` `exploreWidgets(PreflightContext ctx, List<org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget> widgets)` This function explores all fields and their children to validate them.
`void` `validate(PreflightContext ctx)`
`protected boolean` `validateField(PreflightContext ctx, org.apache.pdfbox.pdmodel.interactive.form.PDField field)` A and AA field are forbidden, this method checks if they are present and checks all children of this field.

### Methods inherited from class org.apache.pdfbox.preflight.process.AbstractProcess

`addFontError, addValidationError, addValidationErrors`

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

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

### Constructor Detail

#### AcroFormValidationProcess

    public AcroFormValidationProcess()

### Method Detail

#### validate

    public void validate(PreflightContext ctx)
                  throws ValidationException

Throws:
  `ValidationException`

#### checkNeedAppearences

    protected void checkNeedAppearences(PreflightContext ctx,
                                        org.apache.pdfbox.pdmodel.interactive.form.PDAcroForm acroForm)

This method checks if the NeedAppearances entry is present. If it is, the value must be false. If the entry is invalid, the ERROR_SYNTAX_DICT_INVALID (1.2.3) error is return.

Parameters:
  `ctx` - the preflight context.
  `acroForm` - the AcroForm.

#### exploreFields

    protected boolean exploreFields(PreflightContext ctx,
                                    List<org.apache.pdfbox.pdmodel.interactive.form.PDField> fields)
                             throws IOException

This function explores all fields and their children to validate them.

Parameters:
  `ctx` - the preflight context.
  `fields` - the list of fields, never null.
Returns:
  the result of the validation.
Throws:
  `IOException`
See Also:
  `validateField(PreflightContext, PDField)`

#### exploreWidgets

    protected boolean exploreWidgets(PreflightContext ctx,
                                     List<org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget> widgets)
                              throws IOException

This function explores all fields and their children to validate them.

Parameters:
  `ctx` - the preflight context.
  `widgets` - the list of widgets
Returns:
  the result of the validation.
Throws:
  `IOException`
See Also:
  `validateField(PreflightContext, PDField)`

#### validateField

    protected boolean validateField(PreflightContext ctx,
                                    org.apache.pdfbox.pdmodel.interactive.form.PDField field)
                             throws IOException

A and AA field are forbidden, this method checks if they are present and checks all children of this field. If the an Additional Action is present the error code ERROR_ACTION_FORBIDDEN_ADDITIONAL_ACTIONS_FIELD (6.2.3) is added to the error list If the an Action is present (in the Widget Annotation) the error ERROR_ACTION_FORBIDDEN_WIDGET_ACTION_FIELD (6.2.4) is added to the error list. (Remark : The widget validation will be done by the AnnotationValidationHelper, but some actions are authorized in a standard Widget)

Parameters:
  `ctx` - the preflight context.
  `field` - an acro forms field.
Returns:
  the result of the check for A or AA entries.
Throws:
  `IOException`