public abstract class PDField extends Object implements COSObjectable
Modifier and Type | Field and Description |
---|---|
static int |
FLAG_NO_EXPORT
A Ff flag.
|
static int |
FLAG_READ_ONLY
A Ff flag.
|
static int |
FLAG_REQUIRED
A Ff flag.
|
Constructor and Description |
---|
PDField(PDAcroForm theAcroForm)
Constructor.
|
PDField(PDAcroForm theAcroForm,
COSDictionary field)
Creates a COSField from a COSDictionary, expected to be a correct object definition for a field in PDF.
|
Modifier and Type | Method and Description |
---|---|
String |
findFieldType()
Find the field type and optionally do a recursive upward search.
|
PDField |
findKid(String[] name,
int nameIndex)
This will find one of the child elements.
|
PDAcroForm |
getAcroForm()
This will get the acroform that this field is part of.
|
PDFormFieldAdditionalActions |
getActions()
Get the additional actions for this field.
|
String |
getAlternateFieldName()
Gets the alternate name of the field.
|
COSBase |
getCOSObject()
Convert this standard java object to a COS object.
|
COSDictionary |
getDictionary()
This will get the dictionary associated with this field.
|
int |
getFieldFlags()
This will get the flags for this field.
|
String |
getFieldType()
Get the FT entry of the field.
|
String |
getFullyQualifiedName()
Returns the fully qualified name of the field, which is a concatenation of the names of all the parents fields.
|
List<COSObjectable> |
getKids()
This will get all the kids of this field.
|
PDField |
getParent()
Get the parent field to this field, or null if none exists.
|
String |
getPartialName()
Returns the partial name of the field.
|
abstract String |
getValue()
getValue gets the fields value to as a string.
|
PDAnnotationWidget |
getWidget()
This will get the single associated widget that is part of this field.
|
void |
importFDF(FDFField fdfField)
This will import a fdf field from a fdf document.
|
boolean |
isNoExport() |
boolean |
isReadonly() |
boolean |
isRequired() |
void |
setAcroForm(PDAcroForm value)
This will set the form this field is on.
|
void |
setActions(PDFormFieldAdditionalActions actions)
Set the actions of the field.
|
void |
setAlternateFieldName(String alternateFieldName)
This will set the alternate name of the field.
|
void |
setFieldFlags(int flags)
This will set the flags for this field.
|
protected void |
setFieldType(String fieldType)
Set the field type.
|
void |
setKids(List<COSObjectable> kids)
This will set the list of kids.
|
void |
setNoExport(boolean noExport)
sets the field to be not exported..
|
void |
setParent(PDField parent)
Set the parent of this field.
|
void |
setPartialName(String name)
This will set the partial name of the field.
|
void |
setReadonly(boolean readonly)
sets the field to be read-only.
|
void |
setRequired(boolean required)
sets the field to be required.
|
abstract void |
setValue(String value)
setValue sets the fields value to a given string.
|
String |
toString()
This will return a string representation of this field.
|
public static final int FLAG_READ_ONLY
public static final int FLAG_REQUIRED
public static final int FLAG_NO_EXPORT
public PDField(PDAcroForm theAcroForm)
theAcroForm
- The form that this field is part of.public PDField(PDAcroForm theAcroForm, COSDictionary field)
theAcroForm
- The form that this field is part of.field
- the PDF objet to represent as a field.public String getPartialName()
public void setPartialName(String name)
name
- The new name for the field.public String getFullyQualifiedName() throws IOException
IOException
- If there is an error generating the fully qualified name.public String getAlternateFieldName()
public void setAlternateFieldName(String alternateFieldName)
alternateFieldName
- the alternate name of the fieldpublic String getFieldType()
findFieldType()
public String findFieldType()
public abstract void setValue(String value) throws IOException
value
- the string valueIOException
- If there is an error creating the appearance stream.public abstract String getValue() throws IOException
IOException
- If there is an error getting the value.public void setReadonly(boolean readonly)
readonly
- The new flag for readonly.public boolean isReadonly()
public void setRequired(boolean required)
required
- The new flag for required.public boolean isRequired()
public void setNoExport(boolean noExport)
noExport
- The new flag for noExport.public boolean isNoExport()
public int getFieldFlags()
public void setFieldFlags(int flags)
flags
- The new flags.public void importFDF(FDFField fdfField) throws IOException
fdfField
- The fdf field to import.IOException
- If there is an error importing the data for this field.public PDAnnotationWidget getWidget() throws IOException
IOException
- If there is an error getting the widget object.public PDField getParent() throws IOException
IOException
- If there is an error creating the parent field.public void setParent(PDField parent)
parent
- The parent to this field.public PDField findKid(String[] name, int nameIndex) throws IOException
name
- An array that picks the path to the field.nameIndex
- The index into the array.IOException
- If there is an error creating the field.public List<COSObjectable> getKids() throws IOException
IOException
- If there is an error retrieving the kids.public void setKids(List<COSObjectable> kids)
kids
- The list of child widgets.public String toString()
public PDAcroForm getAcroForm()
public void setAcroForm(PDAcroForm value)
value
- The new form to use.public COSDictionary getDictionary()
public COSBase getCOSObject()
getCOSObject
in interface COSObjectable
public PDFormFieldAdditionalActions getActions()
public void setActions(PDFormFieldAdditionalActions actions)
actions
- The field actions.protected void setFieldType(String fieldType)
fieldType
- the field type string must be one of "Btn", "Ch", "Tx", "Sig"Copyright © 2002-2015 The Apache Software Foundation. All Rights Reserved.