- All Implemented Interfaces:
COSObjectable
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a child to the array of childrenReturns the default value of this field.intThis will get the flags for this field.Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.getValue()Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.Returns the widget annotations associated with this field.booleanbooleanremoveChild(PDField field) Removes the given node from the children listvoidsetChildren(List<PDField> children) Sets the child fields.voidsetDefaultValue(COSBase value) Sets the default of this field.voidSets the plain text value of this field.voidSets the value of this field.Methods inherited from class org.sejda.sambox.pdmodel.interactive.form.PDField
getAcroForm, getActions, getAlternateFieldName, getFullyQualifiedName, getInheritableAttribute, getMappingName, getParent, getPartialName, isNoExport, isReadonly, isRequired, setAlternateFieldName, setFieldFlags, setMappingName, setNoExport, setPartialName, setReadonly, setRequired, toStringMethods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Constructor Details
-
PDNonTerminalField
Constructor.- Parameters:
acroForm- The form that this field is part of.
-
-
Method Details
-
getFieldFlags
public int getFieldFlags()Description copied from class:PDFieldThis will get the flags for this field.- Specified by:
getFieldFlagsin classPDField- Returns:
- flags The set of flags.
-
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
Sets the child fields.- Parameters:
children- The list of child fields.
-
addChild
Adds a child to the array of children- Parameters:
field-
-
removeChild
Removes the given node from the children list- Parameters:
field-- Returns:
- the removed COSBase or null
-
getFieldType
Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.
- Specified by:
getFieldTypein classPDField- Returns:
- The Field type.
-
getValue
Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.
-
getValueAsString
Note: while non-terminal fields do inherit field values, this method returns the local value, without inheritance.
- Specified by:
getValueAsStringin classPDField- Returns:
- A non-null string.
-
setValue
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
Sets the plain text value of this field.- Specified by:
setValuein classPDField- Parameters:
value- Plain text- Throws:
IOException- if the value could not be set
-
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
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
Description copied from class:PDFieldReturns the widget annotations associated with this field.For
PDNonTerminalFieldthe list will be empty as non terminal fields have no visual representation in the form.- Specified by:
getWidgetsin classPDField- Returns:
- A non-null string.
-
isTerminal
public boolean isTerminal()- Specified by:
isTerminalin classPDField
-