TemplateLinkedPosition
Inheritance: java.lang.Object, com.groupdocs.parser.templates.TemplatePosition
public class TemplateLinkedPosition extends TemplatePosition
Provides a template field position which uses the linked field.
The following example shows the code for the situation if it’s known that the field with an invoice number is placed on the right of “Invoice number” string the following code is used:
// Create a regex template field to find "Invoice Number" text
TemplateField invoice = new TemplateField(new TemplateRegexPosition("Invoice Number"), "Invoice");
// Create a related template field associated with "Invoice" field and extract the value on the right of it
TemplateField invoiceNumber = new TemplateField(
new TemplateLinkedPosition("invoice", new Size(100, 15), new TemplateLinkedPositionEdges(false, false, true, false)),
"InvoiceNumber");
Constructors
Constructor | Description |
---|---|
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges) | Initializes a new instance of the TemplateLinkedPosition class. |
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale) | Initializes a new instance of the TemplateLinkedPosition class with UPPER CASE name. |
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale, boolean useUpperCaseName) | Initializes a new instance of the TemplateLinkedPosition class. |
Methods
Method | Description |
---|---|
getLinkedFieldName() | Gets the linked field name. |
getSearchArea() | Gets the size of the area where a field is searched. |
isAutoScale() | Gets the value that indicates whether SearchArea is scaled by the linked field size. |
getEdges() | Gets the edges of the linked field where a field is searched. |
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges)
public TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges)
Initializes a new instance of the TemplateLinkedPosition class.
Parameters:
Parameter | Type | Description |
---|---|---|
linkedFieldName | java.lang.String | The name of the linked field. |
searchArea | Size | The size of the area where a field is searched. |
edges | TemplateLinkedPositionEdges | The edges of the linked field where a field is searched. |
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale)
public TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale)
Initializes a new instance of the TemplateLinkedPosition class with UPPER CASE name.
Parameters:
Parameter | Type | Description |
---|---|---|
linkedFieldName | java.lang.String | The name of the linked field. |
searchArea | Size | The size of the area where a field is searched. |
edges | TemplateLinkedPositionEdges | The edges of the linked field where a field is searched. |
autoScale | boolean | The value that indicates whether searchArea is scaled by the linked field size. |
TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale, boolean useUpperCaseName)
public TemplateLinkedPosition(String linkedFieldName, Size searchArea, TemplateLinkedPositionEdges edges, boolean autoScale, boolean useUpperCaseName)
Initializes a new instance of the TemplateLinkedPosition class.
Parameters:
Parameter | Type | Description |
---|---|---|
linkedFieldName | java.lang.String | The name of the linked field. |
searchArea | Size | The size of the area where a field is searched. |
edges | TemplateLinkedPositionEdges | The edges of the linked field where a field is searched. |
autoScale | boolean | The value that indicates whether searchArea is scaled by the linked field size.\ |
useUpperCaseName | boolean | The value that indicates whether a name is converted to UPPER CASE. |
getLinkedFieldName()
public String getLinkedFieldName()
Gets the linked field name.
Returns: java.lang.String - An uppercase string value that represents the linked field name.
getSearchArea()
public Size getSearchArea()
Gets the size of the area where a field is searched.
Returns: Size - An instance of Size class that represents the size of the area where a field is searched.
isAutoScale()
public Boolean isAutoScale()
Gets the value that indicates whether SearchArea is scaled by the linked field size.
Returns: java.lang.Boolean - {code true} if SearchArea is scaled by the linked field size; otherwise, false .
getEdges()
public TemplateLinkedPositionEdges getEdges()
Gets the edges of the linked field where a field is searched.
Returns: TemplateLinkedPositionEdges - An instance of TemplateLinkedPositionEdges class that represents the edges of the linked field where a field is searched.