Captured Field

Defined in package com.scandit.datacapture.label.data

LabelField
class LabelField

Added in version 6.0.0

name
@NonNull String getName()

Added in version 6.0.0

The field name. Unique within a label, for example barcode-a, or price. The names are defined when defining the label.

type
LabelFieldType getType()

Added in version 6.0.0

Identifies the type of the captured field type. This either returns LabelFieldType.BARCODE, or LabelFieldType.TEXT. Depending on the type, further information such as captured data is available through the following properties:

predictedLocation
@NonNull Quadrilateral getPredictedLocation()

Added in version 6.0.0

The location of the captured field inside the image. These coordinates will need to be converted to view coordinates before they can be visualized. When the field’s state is LabelFieldState.UNKNOWN, a quadrilateral with all points set to (0,0) is returned.

state
LabelFieldState getState()

Added in version 6.0.0

The field state. For fields that have been captured LabelFieldState.CAPTURED is returned. For fields whose location has been predicted, LabelFieldState.PREDICTED is returned. For fields whose location could not be predicted, LabelFieldState.UNKNOWN is returned.

isRequired
boolean isRequired()

Added in version 6.0.0

Whether the captured field is required. This property is false for optional fields.

barcode
@Nullable Barcode getBarcode()

Added in version 6.0.0

The barcode associated to this captured field. This property is null when the type is not equal to LabelFieldType.BARCODE.

text
@Nullable String getText()

Added in version 6.0.0

The text associated to this captured field. This property is null when the type is not equal to LabelFieldType.TEXT.

toJson()
@NonNull String toJson()

Added in version 6.4.0

Returns the JSON representation of the label field.