Package com.itextpdf.forms.xfdf
Class FieldObject
- java.lang.Object
-
- com.itextpdf.forms.xfdf.FieldObject
-
public class FieldObject extends java.lang.ObjectRepresents the field element, a child of the fields and field elements. The field element corresponds to a form field. Content model: ( field* | value* | ( value? & value-richtext? )). Required attributes: name. For more details see paragraph 6.3.2 in XFDF document specification.
-
-
Field Summary
Fields Modifier and Type Field Description private booleancontainsRichTextIndicates if a value-richtext element is present inside the field.private java.lang.StringnameRepresents the name attribute of the field element.private FieldObjectparentParent field of current field.private java.lang.StringrichTextValueRepresents the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string.private java.lang.StringvalueRepresents the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type.
-
Constructor Summary
Constructors Constructor Description FieldObject()Creates an instance ofFieldObject.FieldObject(java.lang.String name, java.lang.String value, boolean containsRichText)Creates an instance ofFieldObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetName()Gets the string value of the name attribute of the field element.FieldObjectgetParent()Gets a parent field of current field.java.lang.StringgetRichTextValue()Gets the string representation of the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string.java.lang.StringgetValue()Gets the string representation of the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type.booleanisContainsRichText()Gets a boolean indicating if a value-richtext element is present inside the field.voidsetContainsRichText(boolean containsRichText)Sets a boolean indicating if a value-richtext element is present inside the field.voidsetName(java.lang.String name)Sets the string value of the name attribute of the field element.voidsetParent(FieldObject parent)Sets a parent field of current field.voidsetRichTextValue(java.lang.String richTextValue)Sets the string representation of the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string.voidsetValue(java.lang.String value)Sets the string representation of the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type.
-
-
-
Field Detail
-
name
private java.lang.String name
Represents the name attribute of the field element. Corresponds to the T key in the field dictionary. In a hierarchical form field, the name is the partial field name. For more details see paragraph 6.3.2.2 in XFDF document specification.
-
value
private java.lang.String value
Represents the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type. Corresponds to the V key in the FDF field dictionary. Content model: text string. For more details see paragraph 6.3.3 in XFDF document specification.
-
richTextValue
private java.lang.String richTextValue
Represents the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string. Corresponds to the RV key in the variable text field dictionary. Content model: text strign or rich text string. Attributes: none. For more details see paragraph 6.3.4 in XFDF document specification.
-
containsRichText
private boolean containsRichText
Indicates if a value-richtext element is present inside the field.
-
parent
private FieldObject parent
Parent field of current field.
-
-
Constructor Detail
-
FieldObject
public FieldObject()
Creates an instance ofFieldObject.
-
FieldObject
public FieldObject(java.lang.String name, java.lang.String value, boolean containsRichText)Creates an instance ofFieldObject.- Parameters:
name- the name attribute of the field elementvalue- the field's valuecontainsRichText- indicates if a value-richtext element is present inside the field
-
-
Method Detail
-
getName
public java.lang.String getName()
Gets the string value of the name attribute of the field element. Corresponds to the T key in the field dictionary. In a hierarchical form field, the name is the partial field name. For more details see paragraph 6.3.2.2 in XFDF document specification.- Returns:
Stringvalue of field name attribute.
-
setName
public void setName(java.lang.String name)
Sets the string value of the name attribute of the field element. Corresponds to the T key in the field dictionary. In a hierarchical form field, the name is the partial field name.- Parameters:
name-Stringvalue of field name attribute
-
getValue
public java.lang.String getValue()
Gets the string representation of the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type. Corresponds to the V key in the FDF field dictionary. For more details see paragraph 6.3.3 in XFDF document specification.- Returns:
Stringrepresentation of inner value element of the field.
-
setValue
public void setValue(java.lang.String value)
Sets the string representation of the value element, a child of the field element and contains the field's value, whose format may vary depending on the field type. Corresponds to the V key in the FDF field dictionary.- Parameters:
value-Stringrepresentation of inner value element of the field
-
getRichTextValue
public java.lang.String getRichTextValue()
Gets the string representation of the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string. Corresponds to the RV key in the variable text field dictionary. Content model: text strign or rich text string. For more details see paragraph 6.3.4 in XFDF document specification.- Returns:
Stringrepresentation of inner value-richtext element of the field.
-
setRichTextValue
public void setRichTextValue(java.lang.String richTextValue)
Sets the string representation of the value-richtext element, a child of the field element and contains the field's value formatted as a rich text string. Corresponds to the RV key in the variable text field dictionary. Content model: text string or rich text string.- Parameters:
richTextValue-Stringrepresentation of inner value-richtext element of the field
-
isContainsRichText
public boolean isContainsRichText()
Gets a boolean indicating if a value-richtext element is present inside the field.- Returns:
- true if a value-richtext element is present inside the field, false otherwise.
-
setContainsRichText
public void setContainsRichText(boolean containsRichText)
Sets a boolean indicating if a value-richtext element is present inside the field.- Parameters:
containsRichText- a boolean indicating if a value-richtext element is present inside the field
-
getParent
public FieldObject getParent()
Gets a parent field of current field.- Returns:
- parent
field objectof the current field.
-
setParent
public void setParent(FieldObject parent)
Sets a parent field of current field.- Parameters:
parent-field objectthat is a parent of the current field
-
-