org.apache.pdfbox.preflight.annotation

## Class WidgetAnnotationValidator

- java.lang.Object
- - org.apache.pdfbox.preflight.annotation.AnnotationValidator
  - - org.apache.pdfbox.preflight.annotation.WidgetAnnotationValidator

    public class WidgetAnnotationValidator
    extends AnnotationValidator

Validation class for the Widget Annotation

### Field Summary

Fields
`protected org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget` `pdWidget` PDFBox object which wraps the annotation dictionary

### Fields inherited from class org.apache.pdfbox.preflight.annotation.AnnotationValidator

`annotDictionary, ctx, pdAnnot`

### Constructor Summary

Constructors
Constructor and Description
`WidgetAnnotationValidator(PreflightContext ctx, org.apache.pdfbox.cos.COSDictionary annotDictionary)`

### Method Summary

All Methods Instance Methods Concrete Methods
`protected boolean` `checkAAField()` The AA field is forbidden for the Widget annotation when the PDF is a PDF/A.
`boolean` `validate()` In addition of the AnnotationValidator.validate() method, this method executes the checkAAField method.

### Methods inherited from class org.apache.pdfbox.preflight.annotation.AnnotationValidator

`checkActions, checkAP, checkCA, checkColors, checkFlags, checkMandatoryFields, checkPopup, checkSpecificMandatoryFields, searchRGBProfile, setFactory`

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

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

### Field Detail

#### pdWidget

    protected org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget pdWidget

PDFBox object which wraps the annotation dictionary

### Constructor Detail

#### WidgetAnnotationValidator

    public WidgetAnnotationValidator(PreflightContext ctx,
                                     org.apache.pdfbox.cos.COSDictionary annotDictionary)

### Method Detail

#### validate

    public boolean validate()
                     throws ValidationException

In addition of the AnnotationValidator.validate() method, this method executes the checkAAField method.

Overrides:
  `validate` in class `AnnotationValidator`
Returns:
  true if validation succeed, false otherwise.
Throws:
  `ValidationException`
See Also:
  `AnnotationValidator.validate()`

#### checkAAField

    protected boolean checkAAField()

The AA field is forbidden for the Widget annotation when the PDF is a PDF/A. This method return false and update the errors list if this key is present. returns true otherwise

Returns:
  false if the forbidden AA field is existing.