FieldData

Inheritance: java.lang.Object

public class FieldData

Represents field data such as a name, a page index, a field value and so on. Depending on the field the value can be a text, an image, a table and so on.

The instances of FieldData class are used in DocumentData collection.

Constructors

Constructor Description
FieldData(String name, PageArea pageArea) Initializes a new instance of the FieldData class with UPPER CASE name.
FieldData(String name, PageArea pageArea, boolean useUpperCaseName) Initializes a new instance of the FieldData class.
FieldData(String name, PageArea pageArea, FieldData linkedField) Initializes a new instance of the FieldData class with UPPER CASE name.
FieldData(String name, PageArea pageArea, FieldData linkedField, boolean useUpperCaseName) Initializes a new instance of the FieldData class.

Methods

Method Description
getName() Gets the field name.
getPageIndex() Gets the page index.
getPageArea() Gets the value of the field.
getLinkedField() Gets the linked field.
getText() Gets the text.
getUseUpperCaseName() Gets a value that indicates whether a Name was converted to UPPER CASE.

FieldData(String name, PageArea pageArea)

public FieldData(String name, PageArea pageArea)

Initializes a new instance of the FieldData class with UPPER CASE name.

Parameters:

Parameter Type Description
name java.lang.String The name of the field.
pageArea PageArea The value of the field.

FieldData(String name, PageArea pageArea, boolean useUpperCaseName)

public FieldData(String name, PageArea pageArea, boolean useUpperCaseName)

Initializes a new instance of the FieldData class.

Parameters:

Parameter Type Description
name java.lang.String The name of the field.
pageArea PageArea The value of the field.
useUpperCaseName boolean The value that indicates whether a name is converted to UPPER CASE.

FieldData(String name, PageArea pageArea, FieldData linkedField)

public FieldData(String name, PageArea pageArea, FieldData linkedField)

Initializes a new instance of the FieldData class with UPPER CASE name.

Parameters:

Parameter Type Description
name java.lang.String The name of the field.
pageArea PageArea The value of the field.
linkedField FieldData The field which is linked to the field.

FieldData(String name, PageArea pageArea, FieldData linkedField, boolean useUpperCaseName)

public FieldData(String name, PageArea pageArea, FieldData linkedField, boolean useUpperCaseName)

Initializes a new instance of the FieldData class.

Parameters:

Parameter Type Description
name java.lang.String The name of the field.
pageArea PageArea The value of the field.
linkedField FieldData The field which is linked to the field.
useUpperCaseName boolean The value that indicates whether a name is converted to UPPER CASE.

getName()

public String getName()

Gets the field name.

Returns: java.lang.String - An uppercase string value that represents the name of the field.

getPageIndex()

public int getPageIndex()

Gets the page index.

Returns: int - A zero-based index of the page that contains the field.

getPageArea()

public PageArea getPageArea()

Gets the value of the field.

Depending on field PageArea property can contain any of the inheritors of PageArea class. For example, Parser.parseForm() method extracts only text fields.

PageTextArea area = field.getPageArea() instanceof PageTextArea
         ? (PageTextArea) field.getPageArea()
         : null;
 System.out.println(area == null ? "Not a template field" : area.getText());
 

Returns: PageArea - An instance of PageArea class that represents the value of the field.

getLinkedField()

public FieldData getLinkedField()

Gets the linked field.

Returns: FieldData - An instance of FieldData class that represents the field which is linked to the field; null if it isn’t set.

getText()

public String getText()

Gets the text.

Returns: java.lang.String - A string value that represents a value of the field text; null if PageArea property isn’t PageTextArea.

getUseUpperCaseName()

public boolean getUseUpperCaseName()

Gets a value that indicates whether a Name was converted to UPPER CASE.

Returns: boolean - A boolean value that indicates whether a Name was converted to UPPER CASE.