Label Field Definition Builder

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

LabelFieldDefinitionBuilder
class LabelFieldDefinitionBuilder<BuilderType, FieldType>

Added in version 6.21.0

Generic base class for field definition builders. Provides common functionality for configuring field properties such as patterns, optional status, and hidden properties.

isOptional
boolean isOptional()
void setOptional(boolean value)

Added in version 6.21.0

Whether the field is optional or mandatory. This is helpful when certain fields may not be present on every scan.

patterns
@NonNull Iterable<@NonNull String> getPatterns()
void setPatterns(@NonNull Iterable<@NonNull String> value)

Added in version 6.21.0

The patterns used for content validation of this field.

isOptional(optional)
@NonNull BuilderType isOptional(boolean optional)

Added in version 6.21.0

Sets whether the field is optional or mandatory.

numberOfMandatoryInstances
@Nullable Integer getNumberOfMandatoryInstances()
void setNumberOfMandatoryInstances(@Nullable Integer value)

Added in version 7.6.0

The minimum number of instances of this field that must be captured for the label to be considered complete. This is useful for fields that may appear multiple times on a label, such as multiple serial numbers or repeated information.

setNumberOfMandatoryInstances(numberOfMandatoryInstances)
@NonNull BuilderType setNumberOfMandatoryInstances(
        @Nullable Integer numberOfMandatoryInstances)

Added in version 7.6.0

The minimum number of instances of this field that must be captured for the label to be considered complete. This is useful for fields that may appear multiple times on a label, such as multiple serial numbers or repeated information.

setPatterns(patterns)
@NonNull BuilderType setPatterns(@NonNull String patterns)

Added in version 6.21.0

Sets the patterns used for content validation from a single string.

setPatterns(patterns)
@NonNull BuilderType setPatterns(@NonNull Iterable<@NonNull String> patterns)

Added in version 6.21.0

Sets the patterns used for content validation from a collection of strings.

setPattern(pattern)
@NonNull BuilderType setPattern(@NonNull String pattern)

Added in version 6.21.0

Sets a single pattern for content validation.

setPattern(pattern)
@NonNull BuilderType setPattern(@NonNull Regex pattern)

Added in version 6.21.0

Sets a regular expression pattern for content validation.

setHiddenProperty(key, value)
@NonNull BuilderType setHiddenProperty(@NonNull String key,
        @NonNull Object value)

Added in version 6.21.0

setHiddenProperties(hiddenProperties)
@NonNull BuilderType setHiddenProperties(@NonNull Map<@NonNull String, @NonNull Object> hiddenProperties)

Added in version 6.21.0

build(name)
@NonNull FieldType build(@NonNull String name)

Added in version 6.21.0

Creates a field definition with the specified name and all configured properties.

buildFluent(name)
@NonNull LabelDefinitionBuilder buildFluent(@NonNull String name)

Added in version 6.21.0

Creates a field definition and returns a label definition builder for method chaining.