Package com.itextpdf.forms.xfdf
Class FieldObject
- java.lang.Object
-
- com.itextpdf.forms.xfdf.FieldObject
-
public class FieldObject extends java.lang.Object
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.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
containsRichText
Indicates if a value-richtext element is present inside the field.private java.lang.String
name
Represents the name attribute of the field element.private FieldObject
parent
Parent field of current field.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.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.
-
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.String
getName()
Gets the string value of the name attribute of the field element.FieldObject
getParent()
Gets a parent field of current field.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.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.boolean
isContainsRichText()
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
setName(java.lang.String name)
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(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.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.
-
-
-
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:
String
value 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
-String
value 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:
String
representation 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
-String
representation 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:
String
representation 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
-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
public FieldObject getParent()
Gets a parent field of current field.- Returns:
- parent
field object
of the current field.
-
setParent
public void setParent(FieldObject parent)
Sets a parent field of current field.- Parameters:
parent
-field object
that is a parent of the current field
-
-