Class PDNonTerminalField

All Implemented Interfaces:
COSObjectable

public class PDNonTerminalField extends PDField
A non terminal field in an interactive form.

A non terminal field is a node in the fields tree node whose descendants are fields.

The attributes such as FT (field type) or V (field value) do not logically belong to the non terminal field but are inheritable attributes for descendant terminal fields.

  • Constructor Details

    • PDNonTerminalField

      public PDNonTerminalField(PDAcroForm acroForm)
      Constructor.
      Parameters:
      acroForm - The form that this field is part of.
  • Method Details

    • getFieldFlags

      public int getFieldFlags()
      Description copied from class: PDField
      This will get the flags for this field.
      Specified by:
      getFieldFlags in class PDField
      Returns:
      flags The set of flags.
    • getChildren

      public List<PDField> getChildren()
      Returns:
      this field's children. These may be either terminal or non-terminal fields.
    • hasChildren

      public boolean hasChildren()
      Returns:
      true if the field has at least one child
    • setChildren

      public void setChildren(List<PDField> children)
      Sets the child fields.
      Parameters:
      children - The list of child fields.
    • addChild

      public void addChild(PDField field)
      Adds a child to the array of children
      Parameters:
      field -
    • removeChild

      public COSBase removeChild(PDField field)
      Removes the given node from the children list
      Parameters:
      field -
      Returns:
      the removed COSBase or null
    • getFieldType

      public String getFieldType()

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

      Specified by:
      getFieldType in class PDField
      Returns:
      The Field type.
    • getValue

      public COSBase getValue()

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

    • getValueAsString

      public String getValueAsString()

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

      Specified by:
      getValueAsString in class PDField
      Returns:
      A non-null string.
    • setValue

      public void setValue(COSBase object)
      Sets the value of this field. This may be of any kind which is valid for this field's children.

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

    • setValue

      public void setValue(String value)
      Sets the plain text value of this field.
      Specified by:
      setValue in class PDField
      Parameters:
      value - Plain text
      Throws:
      IOException - if the value could not be set
    • getDefaultValue

      public COSBase getDefaultValue()
      Returns the default value of this field. This may be of any kind which is valid for this field's children.

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

    • setDefaultValue

      public void setDefaultValue(COSBase value)
      Sets the default of this field. This may be of any kind which is valid for this field's children.

      Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.

    • getWidgets

      public List<PDAnnotationWidget> getWidgets()
      Description copied from class: PDField
      Returns the widget annotations associated with this field.

      For PDNonTerminalField the list will be empty as non terminal fields have no visual representation in the form.

      Specified by:
      getWidgets in class PDField
      Returns:
      A non-null string.
    • isTerminal

      public boolean isTerminal()
      Specified by:
      isTerminal in class PDField