Custom Barcode Builder

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

CustomBarcodeBuilder
class CustomBarcodeBuilder : BarcodeFieldBuilder

Added in version 6.21.0

Builder class for creating CustomBarcode field definitions. Provides a fluent interface for configuring barcode field properties including symbologies, validation regexes, location constraints, and other field-specific settings.

location
var location: LabelFieldLocation?

Added in version 6.21.0

The expected location of this barcode field within the label.

setLocation(location)
fun setLocation(location: LabelFieldLocation): CustomBarcodeBuilder

Added in version 6.21.0

Sets the expected location of this barcode field within the label using a predefined or custom location.

setLocation(location)
fun setLocation(location: RectF): CustomBarcodeBuilder

Added in version 6.21.0

Sets the expected location of this barcode field using exact coordinates.

setLocation(left, top, right, bottom)
fun setLocation(left: Float,
        top: Float,
        right: Float,
        bottom: Float): CustomBarcodeBuilder

Added in version 6.21.0

Sets the expected location of this barcode field using coordinate values.

setLocation(location)
fun setLocation(location: Rect): CustomBarcodeBuilder

Added in version 6.21.0

Sets the expected location of this barcode field using a rectangle.

setAnchorRegexes(anchorRegexes)
fun setAnchorRegexes(anchorRegexes: String): CustomBarcodeBuilder

Added in version 8.0.0

Sets a single anchor regex for this barcode field.

setAnchorRegexes(anchorRegexes)
fun setAnchorRegexes(anchorRegexes: Iterable<String>): CustomBarcodeBuilder

Added in version 8.0.0

Used to specify keywords or phrases that help identify the context of the field. This is particularly useful when the label contains multiple fields that could match the same regex (e.g., when both packaging and expiry dates are present).

setAnchorRegex(anchorRegex)
fun setAnchorRegex(anchorRegex: Regex): CustomBarcodeBuilder

Added in version 8.0.0

Used to specify keywords or phrases that help identify the context of the field. This is particularly useful when the label contains multiple fields that could match the same regex (e.g., when both packaging and expiry dates are present).

build(name)
fun build(name: String): CustomBarcode

Added in version 6.21.0

Creates a CustomBarcode field definition with the specified name and all configured properties. This method finalizes the builder configuration and returns a field definition that can be added to a LabelDefinition.

getThis()
fun getThis(): CustomBarcodeBuilder

Added in version 6.21.0

Returns this builder instance for method chaining.