This represents an FDF field that is part of the FDF document.
Method from org.apache.pdfbox.pdmodel.fdf.FDFField Detail: |
public PDAction getAction() {
return PDActionFactory.createAction( (COSDictionary)field.getDictionaryObject( "A" ) );
}
This will get the action that is associated with this field. |
public PDAdditionalActions getAdditionalActions() {
PDAdditionalActions retval = null;
COSDictionary dict = (COSDictionary)field.getDictionaryObject( "AA" );
if( dict != null )
{
retval = new PDAdditionalActions( dict );
}
return retval;
}
This will get a list of additional actions that will get executed based
on events. |
public PDAppearanceDictionary getAppearanceDictionary() {
PDAppearanceDictionary retval = null;
COSDictionary dict = (COSDictionary)field.getDictionaryObject( "AP" );
if( dict != null )
{
retval = new PDAppearanceDictionary( dict );
}
return retval;
}
This will get the appearance dictionary that specifies the appearance of
a pushbutton field. |
public FDFNamedPageReference getAppearanceStreamReference() {
FDFNamedPageReference retval = null;
COSDictionary ref = (COSDictionary)field.getDictionaryObject( "APRef" );
if( ref != null )
{
retval = new FDFNamedPageReference( ref );
}
return retval;
}
This will get named page references.. |
public COSDictionary getCOSDictionary() {
return field;
}
Convert this standard java object to a COS object. |
public COSBase getCOSObject() {
return field;
}
Convert this standard java object to a COS object. |
public Integer getClearFieldFlags() {
Integer retval = null;
COSNumber ff = (COSNumber)field.getDictionaryObject( "ClrFf" );
if( ff != null )
{
retval = new Integer( ff.intValue() );
}
return retval;
}
This will get the ClrFf entry of the cos dictionary. If it it not present then
this method will return null. |
public Integer getClearWidgetFieldFlags() {
Integer retval = null;
COSNumber ff = (COSNumber)field.getDictionaryObject( "ClrF" );
if( ff != null )
{
retval = new Integer( ff.intValue() );
}
return retval;
}
This will get the ClrF entry of the cos dictionary. If it it not present then
this method will return null. |
public Integer getFieldFlags() {
Integer retval = null;
COSNumber ff = (COSNumber)field.getDictionaryObject( "Ff" );
if( ff != null )
{
retval = new Integer( ff.intValue() );
}
return retval;
}
This will get the Ff entry of the cos dictionary. If it it not present then
this method will return null. |
public FDFIconFit getIconFit() {
FDFIconFit retval = null;
COSDictionary dic = (COSDictionary)field.getDictionaryObject( "IF" );
if( dic != null )
{
retval = new FDFIconFit( dic );
}
return retval;
}
This will get the icon fit that is associated with this field. |
public List getKids() {
COSArray kids = (COSArray)field.getDictionaryObject( "Kids" );
List retval = null;
if( kids != null )
{
List actuals = new ArrayList();
for( int i=0; i< kids.size(); i++ )
{
actuals.add( new FDFField( (COSDictionary)kids.getObject( i ) ) );
}
retval = new COSArrayList( actuals, kids );
}
return retval;
}
This will get the list of kids. This will return a list of FDFField objects.
This will return null if the underlying list is null. |
public List getOptions() {
List retval = null;
COSArray array = (COSArray)field.getDictionaryObject( "Opt" );
if( array != null )
{
List objects = new ArrayList();
for( int i=0; i< array.size(); i++ )
{
COSBase next = array.getObject( i );
if( next instanceof COSString )
{
objects.add( ((COSString)next).getString() );
}
else
{
COSArray value = (COSArray)next;
objects.add( new FDFOptionElement( value ) );
}
}
retval = new COSArrayList( objects, array );
}
return retval;
}
This will return a list of options for a choice field. The value in the
list will be 1 of 2 types. java.lang.String or FDFOptionElement. |
public String getPartialFieldName() {
return field.getString( "T" );
}
This will get the "T" entry in the field dictionary. A partial field
name. Where the fully qualified field name is a concatenation of
the parent's fully qualified field name and "." as a separator. For example
Address.State
Address.City
|
public PDTextStream getRichText() {
COSBase rv = field.getDictionaryObject( "RV" );
return PDTextStream.createTextStream( rv );
}
This will set the rich text that is associated with this field. |
public Integer getSetFieldFlags() {
Integer retval = null;
COSNumber ff = (COSNumber)field.getDictionaryObject( "SetFf" );
if( ff != null )
{
retval = new Integer( ff.intValue() );
}
return retval;
}
This will get the SetFf entry of the cos dictionary. If it it not present then
this method will return null. |
public Integer getSetWidgetFieldFlags() {
Integer retval = null;
COSNumber ff = (COSNumber)field.getDictionaryObject( "SetF" );
if( ff != null )
{
retval = new Integer( ff.intValue() );
}
return retval;
}
This will get the SetF entry of the cos dictionary. If it it not present then
this method will return null. |
public Object getValue() throws IOException {
Object retval = null;
COSBase value = field.getDictionaryObject( "V" );
if( value instanceof COSName )
{
retval = ((COSName)value).getName();
}
else if( value instanceof COSArray )
{
retval = COSArrayList.convertCOSStringCOSArrayToList( (COSArray)value );
}
else if( value instanceof COSString || value instanceof COSStream )
{
retval = PDTextStream.createTextStream( value );
}
else if( value == null )
{
//Ok, value is null so do nothing
}
else
{
throw new IOException( "Error:Unknown type for field import" + value );
}
return retval;
}
This will set the value for the field. This will return type will either be
String : Checkboxes, Radio Button
java.util.List of strings: Choice Field
PDTextStream: Textfields |
public Integer getWidgetFieldFlags() {
Integer retval = null;
COSNumber f = (COSNumber)field.getDictionaryObject( "F" );
if( f != null )
{
retval = new Integer( f.intValue() );
}
return retval;
}
This will get the F entry of the cos dictionary. If it it not present then
this method will return null. |
public void setAction(PDAction a) {
field.setItem( "A", a );
}
This will set the action that is associated with this field. |
public void setAdditionalActions(PDAdditionalActions aa) {
field.setItem( "AA", aa );
}
This will set the additional actions that are associated with this field. |
public void setAppearanceDictionary(PDAppearanceDictionary ap) {
field.setItem( "AP", ap );
}
This will set the appearance dictionary. |
public void setAppearanceStreamReference(FDFNamedPageReference ref) {
field.setItem( "APRef", ref );
}
This will set the named page references. |
public void setClearFieldFlags(Integer ff) {
COSInteger value = null;
if( ff != null )
{
value = COSInteger.get( ff );
}
field.setItem( "ClrFf", value );
}
This will get the field flags that are associated with this field. The ClrFf entry
in the FDF field dictionary. |
public void setClearFieldFlags(int ff) {
field.setInt( "ClrFf", ff );
}
This will get the field flags that are associated with this field. The ClrFf entry
in the FDF field dictionary. |
public void setClearWidgetFieldFlags(Integer ff) {
COSInteger value = null;
if( ff != null )
{
value = COSInteger.get( ff );
}
field.setItem( "ClrF", value );
}
This will get the field flags that are associated with this field. The ClrF entry
in the FDF field dictionary. |
public void setClearWidgetFieldFlags(int ff) {
field.setInt( "ClrF", ff );
}
This will get the field flags that are associated with this field. The ClrF entry
in the FDF field dictionary. |
public void setFieldFlags(Integer ff) {
COSInteger value = null;
if( ff != null )
{
value = COSInteger.get( ff );
}
field.setItem( "Ff", value );
}
This will get the field flags that are associated with this field. The Ff entry
in the FDF field dictionary. |
public void setFieldFlags(int ff) {
field.setInt( "Ff", ff );
}
This will get the field flags that are associated with this field. The Ff entry
in the FDF field dictionary. |
public void setIconFit(FDFIconFit fit) {
field.setItem( "IF", fit );
}
This will set the icon fit entry. |
public void setKids(List kids) {
field.setItem( "Kids", COSArrayList.converterToCOSArray( kids ) );
}
This will set the list of kids. |
public void setOptions(List options) {
COSArray value = COSArrayList.converterToCOSArray( options );
field.setItem( "Opt", value );
}
This will set the options for the choice field. The objects in the list
should either be java.lang.String or FDFOptionElement. |
public void setPartialFieldName(String partial) {
field.setString( "T", partial );
}
This will set the partial field name. |
public void setRichText(PDTextStream rv) {
field.setItem( "RV", rv );
}
This will set the rich text value. |
public void setSetFieldFlags(Integer ff) {
COSInteger value = null;
if( ff != null )
{
value = COSInteger.get( ff );
}
field.setItem( "SetFf", value );
}
This will get the field flags that are associated with this field. The SetFf entry
in the FDF field dictionary. |
public void setSetFieldFlags(int ff) {
field.setInt( "SetFf", ff );
}
This will get the field flags that are associated with this field. The SetFf entry
in the FDF field dictionary. |
public void setSetWidgetFieldFlags(Integer ff) {
COSInteger value = null;
if( ff != null )
{
value = COSInteger.get( ff );
}
field.setItem( "SetF", value );
}
This will get the widget field flags that are associated with this field. The SetF entry
in the FDF field dictionary. |
public void setSetWidgetFieldFlags(int ff) {
field.setInt( "SetF", ff );
}
This will get the widget field flags that are associated with this field. The SetF entry
in the FDF field dictionary. |
public void setValue(Object value) throws IOException {
COSBase cos = null;
if( value instanceof List )
{
cos = COSArrayList.convertStringListToCOSStringCOSArray( (List)value );
}
else if( value instanceof String )
{
cos = COSName.getPDFName( (String)value );
}
else if( value instanceof COSObjectable )
{
cos = ((COSObjectable)value).getCOSObject();
}
else if( value == null )
{
//do nothing and let cos remain null as well.
}
else
{
throw new IOException( "Error:Unknown type for field import" + value );
}
field.setItem( "V", cos );
}
You should pass in a string, or a java.util.List of strings to set the
value. |
public void setWidgetFieldFlags(Integer f) {
COSInteger value = null;
if( f != null )
{
value = COSInteger.get( f );
}
field.setItem( "F", value );
}
This will get the widget field flags that are associated with this field. The F entry
in the FDF field dictionary. |
public void setWidgetFieldFlags(int f) {
field.setInt( "F", f );
}
This will get the field flags that are associated with this field. The F entry
in the FDF field dictionary. |
public void writeXML(Writer output) throws IOException {
output.write( "< field name=\"" + getPartialFieldName() + "\" >\n");
Object value = getValue();
if( value != null )
{
output.write( "< value >" + value + "< /value >\n" );
}
PDTextStream rt = getRichText();
if( rt != null )
{
output.write( "< value-richtext >" + rt.getAsString() + "< /value-richtext >\n" );
}
List kids = getKids();
if( kids != null )
{
for( int i=0; i< kids.size(); i++ )
{
((FDFField)kids.get( i ) ).writeXML( output );
}
}
output.write( "< /field >\n");
}
This will write this element as an XML document. |