Class FormField

  • All Implemented Interfaces:

    
    public class FormField
    
                        

    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 .

    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.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      FormType getType() Type of the form field.
      String getName() 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 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).
      List<out FormElement> getFormElements() Retrieve list of form elements that represents this field visually.
      String getFullyQualifiedName() Returns the fully qualified name of the form field.
      FormElement getFormElement() Returns first form element.
      boolean isDirty() Checks whether the form field is dirty (any value was modified).
      boolean reset() Resets form field to its original value.
      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 isExported() If set, the field shall be exported by a submit-form action.
      InternalFormFieldApi getInternal() Returns the InternalFormFieldApi.
      Action getAdditionalAction(@NonNull() AnnotationTriggerEvent triggerEvent) Returns the action that should be executed on annotation trigger event.
      int hashCode()
      boolean equals(Object o)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getMappingName

        @NonNull() 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.

      • getAlternateFieldName

        @NonNull() 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.

      • getFormElements

        @NonNull() List<out 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.

      • getFullyQualifiedName

        @NonNull() 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 `.`

      • isDirty

         boolean isDirty()

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

        Returns:

        true when field has unsaved changes.

      • reset

         boolean reset()

        Resets form field to its original value.

        Returns:

        true when field has been changed.

      • isReadOnly

         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.

      • isRequired

         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.

      • isExported

         boolean isExported()

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

        Returns:

        true when field should be exported when submitting form.