java.lang.Object
org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
org.sejda.sambox.pdmodel.interactive.form.PDField
- All Implemented Interfaces:
COSObjectable
- Direct Known Subclasses:
PDNonTerminalField,PDTerminalField
A field in an interactive form.
-
Method Summary
Modifier and TypeMethodDescriptionThis will get the acroform that this field is part of.Get the additional actions for this field.Gets the alternate name of the field ("shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field)").abstract intThis will get the flags for this field.abstract StringGet the FT entry of the field.Returns the fully qualified name of the field, which is a concatenation of the names of all the parents fields.protected COSBaseReturns the given attribute, inheriting from parent nodes if necessary.Gets the mapping name of the field.Get the parent field to this field, or null if none exists.Returns the partial name of the field.abstract StringReturns a string representation of the "V" entry, or an empty string.abstract List<PDAnnotationWidget>Returns the widget annotations associated with this field.booleanbooleanbooleanabstract booleanvoidsetAlternateFieldName(String alternateFieldName) This will set the alternate name of the field ("shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field)").voidsetFieldFlags(int flags) This will set the flags for this field.voidsetMappingName(String mappingName) This will set the mapping name of the field.voidsetNoExport(boolean noExport) sets the field to be not exported.voidsetPartialName(String name) This will set the partial name of the field.voidsetReadonly(boolean readonly) sets the field to be read-only.voidsetRequired(boolean required) sets the field to be required.abstract voidSets the value of the field.toString()Methods inherited from class org.sejda.sambox.pdmodel.common.PDDictionaryWrapper
equals, getCOSObject, hashCode
-
Method Details
-
getInheritableAttribute
Returns the given attribute, inheriting from parent nodes if necessary.- Parameters:
key- the key to look up- Returns:
- COS value for the given key
-
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.- Returns:
- The Field type.
-
getValueAsString
Returns a string representation of the "V" entry, or an empty string.- Returns:
- A non-null string.
-
setValue
Sets the value of the field.- Parameters:
value- the new field value.- Throws:
IOException- if the value could not be set
-
getWidgets
Returns the widget annotations associated with this field.For
PDNonTerminalFieldthe list will be empty as non terminal fields have no visual representation in the form.- Returns:
- A non-null string.
-
setReadonly
public void setReadonly(boolean readonly) sets the field to be read-only.- Parameters:
readonly- The new flag for readonly.
-
isReadonly
public boolean isReadonly()- Returns:
- true if the field is readonly
-
setRequired
public void setRequired(boolean required) sets the field to be required.- Parameters:
required- The new flag for required.
-
isRequired
public boolean isRequired()- Returns:
- true if the field is required
-
setNoExport
public void setNoExport(boolean noExport) sets the field to be not exported.- Parameters:
noExport- The new flag for noExport.
-
isNoExport
public boolean isNoExport()- Returns:
- true if the field is not to be exported.
-
getFieldFlags
public abstract int getFieldFlags()This will get the flags for this field.- Returns:
- flags The set of flags.
-
setFieldFlags
public void setFieldFlags(int flags) This will set the flags for this field.- Parameters:
flags- The new flags.
-
getActions
Get the additional actions for this field. This will return null if there are no additional actions for this field.- Returns:
- The actions of the field.
-
getParent
Get the parent field to this field, or null if none exists.- Returns:
- The parent field.
-
getAcroForm
This will get the acroform that this field is part of.- Returns:
- The form this field is on.
-
getPartialName
Returns the partial name of the field.- Returns:
- the name of the field
-
setPartialName
This will set the partial name of the field.- Parameters:
name- The new name for the field.
-
getFullyQualifiedName
Returns the fully qualified name of the field, which is a concatenation of the names of all the parents fields.- Returns:
- the name of the field
-
getAlternateFieldName
Gets the alternate name of the field ("shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field)").- Returns:
- the alternate name of the field
-
setAlternateFieldName
This will set the alternate name of the field ("shall be used in place of the actual field name wherever the field shall be identified in the user interface (such as in error or status messages referring to the field)"). The text appears as a tool tip in Adobe Reader. Because of the usage for error or status messages, it should be different for each field.- Parameters:
alternateFieldName- the alternate name of the field
-
getMappingName
Gets the mapping name of the field.The mapping name shall be used when exporting interactive form field data from the document.
- Returns:
- the mapping name of the field
-
setMappingName
This will set the mapping name of the field.- Parameters:
mappingName- the mapping name of the field
-
isTerminal
public abstract boolean isTerminal() -
toString
-