public class

FormField

extends Object
java.lang.Object
   ↳ com.pspdfkit.forms.FormField
Known Direct Subclasses
Known Indirect Subclasses

Class Overview

A form field. Each form field can have multiple child FormElements. For example, radio button group is a RadioButtonFormField, while each radio button in a group is a RadioButtonFormElement.

Forms can be grouped in a tree hierarchy. The otherwise empty hierarchy elements are not returned as a form field. All that happens is that the fully qualified name contains the full hierarchy name, separated by a dot.

Summary

Public Methods
boolean equals(Object o)
String getAlternateFieldName()
An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field).
FormElement getFormElement()
Returns first form element.
List<? extends FormElement> getFormElements()
Retrieve list of form elements that represents this field visually.
String getFullyQualifiedName()
Returns the fully qualified name of the form field.
String getMappingName()
(Optional; PDF 1.3) The mapping name that shall be used when exporting interactive form field data from the document.
String getName()
Name of the form field.
FormType getType()
Type of the form field.
int hashCode()
boolean isDirty()
Checks whether the form field is dirty (any value was modified).
boolean isExported()
If set, the field shall be exported by a submit-form action.
boolean isReadOnly()
If set, the user may not change the value of this field.
boolean isRequired()
If set, the field shall have a value at the time it is exported by a submit-form action.
boolean reset()
Resets form field to its original value.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public boolean equals (Object o)

public String getAlternateFieldName ()

An alternate field name that shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field). This text is also useful when extracting the document’s contents in support of accessibility to users with disabilities or for other purposes.

Returns
  • The alternate field name or empty string if not available.

public FormElement getFormElement ()

Returns first form element.

public List<? extends FormElement> getFormElements ()

Retrieve list of form elements that represents this field visually. Each FormElement can be part of a single field and each field can contain multiple form elements.

Returns
  • List of child form elements.

public String getFullyQualifiedName ()

Returns the fully qualified name of the form field.

Returns
  • Returns fully qualified name of the form field including the parents names separated by `.`

public String getMappingName ()

(Optional; PDF 1.3) The mapping name that shall be used when exporting interactive form field data from the document.

Returns
  • mapping name if exists, empty string if not available.

public String getName ()

Name of the form field.

Returns
  • The name of the form field.

public FormType getType ()

Type of the form field.

Returns
  • The type of the form field.

public int hashCode ()

public boolean isDirty ()

Checks whether the form field is dirty (any value was modified).

Returns
  • true when field has unsaved changes.

public boolean isExported ()

If set, the field shall be exported by a submit-form action.

Returns
  • true when field should be exported when submitting form.

public boolean isReadOnly ()

If set, the user may not change the value of this field. This flag is useful for fields whose values are computed or imported from a database.

Returns
  • true when field is read-only.

public boolean isRequired ()

If set, the field shall have a value at the time it is exported by a submit-form action.

Returns
  • true when field is required.

public boolean reset ()

Resets form field to its original value.

Returns
  • true when field has been changed.