Package com.itextpdf.forms.xfdf
Class FieldObject
java.lang.Object
com.itextpdf.forms.xfdf.FieldObject
Represents 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.
-
Constructor Summary
ConstructorDescriptionCreates an instance ofFieldObject
.FieldObject
(String name, String value, boolean containsRichText) Creates an instance ofFieldObject
. -
Method Summary
Modifier and TypeMethodDescriptiongetName()
Gets the string value of the name attribute of the field element.Gets a parent field of current field.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.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.boolean
Gets a boolean indicating if a value-richtext element is present inside the field.void
setContainsRichText
(boolean containsRichText) Sets a boolean indicating if a value-richtext element is present inside the field.void
Sets the string value of the name attribute of the field element.void
setParent
(FieldObject parent) Sets a parent field of current field.void
setRichTextValue
(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.void
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.
-
Constructor Details
-
FieldObject
public FieldObject()Creates an instance ofFieldObject
. -
FieldObject
Creates an instance ofFieldObject
.- Parameters:
-
name
- the name attribute of the field element -
value
- the field's value -
containsRichText
- indicates if a value-richtext element is present inside the field
-
-
Method Details
-
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:
-
String
value of field name attribute.
-
setName
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
-String
value of field name attribute
-
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:
-
String
representation of inner value element of the field.
-
setValue
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
-String
representation of inner value element of the field
-
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:
-
String
representation of inner value-richtext element of the field.
-
setRichTextValue
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
-String
representation 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
Gets a parent field of current field.- Returns:
-
parent
field object
of the current field.
-
setParent
Sets a parent field of current field.- Parameters:
-
parent
-field object
that is a parent of the current field
-