Class XfdfField


  • public final class XfdfField
    extends java.lang.Object
    One <field> entry under <fields> (ISO 19444-1 §6.3): a form field's fully-qualified name and its current value(s). XFDF carries only the value -- never a field's widget geometry/appearance -- so internal.FieldMapper only ever updates a field already present in the target PDF's /AcroForm field tree; it never fabricates a new one from an XfdfField alone.

    XFDF allows a field's name to be spelled out two ways: as one fully-qualified, dot-joined name on a single flat <field> (what XfdfWriter always produces), or as nested <field> elements mirroring the AcroForm field hierarchy (which XfdfReader also accepts, for interoperability with other producers). Either way, getQualifiedName() always returns the fully resolved, dot-joined name.

    • Constructor Summary

      Constructors 
      Constructor Description
      XfdfField​(java.lang.String name, XfdfField parent)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addValue​(java.lang.String value)
      Appends one <value> -- normal usage is one call per field, except for a multi-select choice field.
      java.lang.String getName()
      This field's own name segment (not qualified by its ancestors).
      XfdfField getParent()
      The enclosing <field> this one is nested under, or null for a top-level field.
      java.lang.String getQualifiedName()
      The fully-qualified, dot-joined field name, resolved through every ancestor getParent().
      java.lang.String getSingleValue()
      The single value, if there's exactly one -- the common case -- or null if there are zero or several.
      java.util.List<java.lang.String> getValues()
      This field's value(s) -- normally exactly one, but a multi-select Ch (choice) field can carry several <value> children.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XfdfField

        public XfdfField​(java.lang.String name,
                         XfdfField parent)
        Parameters:
        name - this field's own name segment (not qualified by any ancestor)
        parent - the enclosing <field> this one is nested under, or null for a top-level field
    • Method Detail

      • getName

        public java.lang.String getName()
        This field's own name segment (not qualified by its ancestors).
      • getParent

        public XfdfField getParent()
        The enclosing <field> this one is nested under, or null for a top-level field.
      • getQualifiedName

        public java.lang.String getQualifiedName()
        The fully-qualified, dot-joined field name, resolved through every ancestor getParent().
      • getValues

        public java.util.List<java.lang.String> getValues()
        This field's value(s) -- normally exactly one, but a multi-select Ch (choice) field can carry several <value> children. Empty (not null) for a field with no <value> at all (e.g. a checkbox that's unchecked, or a pushbutton).
      • addValue

        public void addValue​(java.lang.String value)
        Appends one <value> -- normal usage is one call per field, except for a multi-select choice field.
      • getSingleValue

        public java.lang.String getSingleValue()
        The single value, if there's exactly one -- the common case -- or null if there are zero or several.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object