Package com.pd4ml.pdf.xfdf
Class XfdfField
- java.lang.Object
-
- com.pd4ml.pdf.xfdf.XfdfField
-
public final class XfdfField extends java.lang.ObjectOne<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 -- sointernal.FieldMapperonly ever updates a field already present in the target PDF's/AcroFormfield tree; it never fabricates a new one from anXfdfFieldalone.XFDF allows a field's name to be spelled out two ways: as one fully-qualified, dot-joined name on a single flat
<field>(whatXfdfWriteralways produces), or as nested<field>elements mirroring the AcroForm field hierarchy (whichXfdfReaderalso accepts, for interoperability with other producers). Either way,getQualifiedName()always returns the fully resolved, dot-joined name.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddValue(java.lang.String value)Appends one<value>-- normal usage is one call per field, except for a multi-select choice field.java.lang.StringgetName()This field's own name segment (not qualified by its ancestors).XfdfFieldgetParent()The enclosing<field>this one is nested under, ornullfor a top-level field.java.lang.StringgetQualifiedName()The fully-qualified, dot-joined field name, resolved through every ancestorgetParent().java.lang.StringgetSingleValue()The single value, if there's exactly one -- the common case -- ornullif there are zero or several.java.util.List<java.lang.String>getValues()This field's value(s) -- normally exactly one, but a multi-selectCh(choice) field can carry several<value>children.java.lang.StringtoString()
-
-
-
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, ornullfor 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, ornullfor a top-level field.
-
getQualifiedName
public java.lang.String getQualifiedName()
The fully-qualified, dot-joined field name, resolved through every ancestorgetParent().
-
getValues
public java.util.List<java.lang.String> getValues()
This field's value(s) -- normally exactly one, but a multi-selectCh(choice) field can carry several<value>children. Empty (notnull) 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 -- ornullif there are zero or several.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-