Top Description Fields Constructors Methods
org.apache.pdfbox.pdmodel.interactive.form

public Class PDNonTerminalField

extends PDField
Class Inheritance
Imports
java.io.IOException, java.util.ArrayList, .Collections, .List, org.apache.commons.logging.Log, .LogFactory, org.apache.pdfbox.cos.COSArray, .COSBase, .COSDictionary, .COSName, org.apache.pdfbox.pdmodel.fdf.FDFField, org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationWidget

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.

Field Summary

Modifier and TypeField and Description
private static final Log

Constructor Summary

AccessConstructor and Description
public
PDNonTerminalField(PDAcroForm
The form that this field is part of.
acroForm
)

Constructor.

pack-priv
PDNonTerminalField(PDAcroForm
The form that this field is part of.
acroForm
,
COSDictionary
the PDF object to represent as a field.
field
,
PDNonTerminalField
the parent node of the node to be created
parent
)

Constructor.

Method Summary

Modifier and TypeMethod and Description
pack-priv FDFField
exportFDF()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.exportFDF.

Exports this field and its children as FDF.

public List<PDField>

Returns:

the list of child fields. Be aware that this list is not backed by the children of the field, so adding or deleting has no effect on the PDF document until you call setChildren() with the modified list.
getChildren
()

Returns this field's children.

public COSBase

Returns:

the new default value
getDefaultValue
()

Returns the default value of this field.

public int
getFieldFlags()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldFlags.

This will get the flags for this field.

public String
getFieldType()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldType.

Get the FT entry of the field.

public COSBase

Returns:

the COSBase value of the "V" entry
getValue
()

Returns the COSBase value of the "V" entry.

public String
getValueAsString()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getValueAsString.

Returns a string representation of the "V" entry, or an empty string.

public List<PDAnnotationWidget>
getWidgets()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getWidgets.

Returns the widget annotations associated with this field.

pack-priv void
importFDF(FDFField
The fdf field to import.
fdfField
)

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDField.importFDF.

This will import a fdf field from a fdf document.

public void
setChildren(List<PDField>
The list of child fields.
children
)

Sets the child fields.

public void
setDefaultValue(COSBase
the default value
value
)

Sets the default of this field.

public void
setValue(COSBase
the new value
object
)

Sets the value of this field.

public void
setValue(String
Plain text
value
)

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.setValue.

Sets the plain text value of this field.

Inherited from org.apache.pdfbox.pdmodel.interactive.form.PDField:
findKidfromDictionarygetAcroFormgetActionsgetAlternateFieldNamegetCOSObjectgetFullyQualifiedNamegetInheritableAttributegetMappingNamegetParentgetPartialNameisNoExportisReadOnlyisRequiredsetAlternateFieldNamesetFieldFlagssetMappingNamesetNoExportsetPartialNamesetReadOnlysetRequiredtoString

Field Detail

LOGback to summary
private static final Log LOG

Constructor Detail

PDNonTerminalFieldback to summary
public PDNonTerminalField(PDAcroForm acroForm)

Constructor.

Parameters
acroForm:PDAcroForm

The form that this field is part of.

PDNonTerminalFieldback to summary
pack-priv PDNonTerminalField(PDAcroForm acroForm, COSDictionary field, PDNonTerminalField parent)

Constructor.

Parameters
acroForm:PDAcroForm

The form that this field is part of.

field:COSDictionary

the PDF object to represent as a field.

parent:PDNonTerminalField

the parent node of the node to be created

Method Detail

exportFDFback to summary
pack-priv FDFField exportFDF() throws IOException

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.exportFDF.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.exportFDF.

Exports this field and its children as FDF.

Annotations
@Override
getChildrenback to summary
public List<PDField> getChildren()

Returns this field's children. These may be either terminal or non-terminal fields.

Returns:List<PDField>

the list of child fields. Be aware that this list is not backed by the children of the field, so adding or deleting has no effect on the PDF document until you call setChildren() with the modified list.

getDefaultValueback to summary
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.

Returns:COSBase

the new default value

getFieldFlagsback to summary
public int getFieldFlags()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldFlags.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldFlags.

This will get the flags for this field.

Returns:int

flags The set of flags.

Annotations
@Override
getFieldTypeback to summary
public String getFieldType()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldType.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.getFieldType.

Get the FT entry of the field. This is a read only field and is set depending on the actual type. The field type is an inheritable attribute.

Note

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

Returns:String

The Field type.

Annotations
@Override
getValueback to summary
public COSBase getValue()

Returns the COSBase value of the "V" entry.

Note

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

Returns:COSBase

the COSBase value of the "V" entry

getValueAsStringback to summary
public String getValueAsString()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getValueAsString.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.getValueAsString.

Returns a string representation of the "V" entry, or an empty string.

Note

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

Returns:String

The list of widget annotations.

Annotations
@Override
getWidgetsback to summary
public List<PDAnnotationWidget> getWidgets()

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.getWidgets.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.getWidgets.

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.

Returns:List<PDAnnotationWidget>

a List of PDAnnotationWidget annotations. Be aware that this list is not backed by the actual widget collection of the field, so adding or deleting has no effect on the PDF document. For PDTerminalField you'd have to call setWidgets() with the modified list.

Annotations
@Override
importFDFback to summary
pack-priv void importFDF(FDFField fdfField) throws IOException

Overrides org.apache.pdfbox.pdmodel.interactive.form.PDField.importFDF.

Doc from org.apache.pdfbox.pdmodel.interactive.form.PDField.importFDF.

This will import a fdf field from a fdf document.

Parameters
fdfField:FDFField

The fdf field to import.

Annotations
@Override
Exceptions
IOException:
If there is an error importing the data for this field.
setChildrenback to summary
public void setChildren(List<PDField> children)

Sets the child fields.

Parameters
children:List<PDField>

The list of child fields.

setDefaultValueback to summary
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.

Parameters
value:COSBase

the default value

setValueback to summary
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.

Parameters
object:COSBase

the new value

setValueback to summary
public void setValue(String value) throws IOException

Implements abstract org.apache.pdfbox.pdmodel.interactive.form.PDField.setValue.

Sets the plain text value of this field.

Parameters
value:String

Plain text

Annotations
@Override
Exceptions
IOException:
if the value could not be set