Barcode Tracking Deserializer

Defined in package com.scandit.datacapture.barcode.serialization

Warning

The deserialization API is not yet stable and will still change over the coming releases.

Note

This deserializer is not thread-safe, subsequent calls for the same settings, mode or overlay have to be called on the same thread.

BarcodeTrackingDeserializer
class BarcodeTrackingDeserializer : DataCaptureModeDeserializer

Added in version 6.1.0

A deserializer to construct barcode tracking from JSON. For most use cases it is enough to use BarcodeTracking.fromJson() which internally uses this deserializer. Using the deserializer gives the advantage of being able to listen to the deserialization events as they happen and potentially influence them. Additionally warnings can be read from the deserializer that would otherwise not be available.

Related topics: Serialization.

BarcodeTrackingDeserializer()
BarcodeTrackingDeserializer()

Added in version 6.1.0

Creates a new deserializer object.

listener
@NonNull BarcodeTrackingDeserializerListener getListener()
void setListener(@NonNull BarcodeTrackingDeserializerListener value)

Added in version 6.1.0

The object informed about deserialization events.

warnings
@NonNull List<@NonNull String> getWarnings()

Added in version 6.1.0

The warnings produced during deserialization, for example which properties were not used during deserialization.

modeFromJson(dataCaptureContext, jsonData)
BarcodeTracking modeFromJson(DataCaptureContext dataCaptureContext,
        @NonNull String jsonData)

Added in version 6.1.0

Deserializes barcode tracking from JSON.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

updateModeFromJson(mode, jsonData)
@NonNull BarcodeTracking updateModeFromJson(@NonNull BarcodeTracking mode,
        @NonNull String jsonData)

Added in version 6.1.0

Takes an existing barcode tracking and updates it by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

settingsFromJson(jsonData)
@NonNull BarcodeTrackingSettings settingsFromJson(@NonNull String jsonData)

Added in version 6.1.0

Deserializes barcode tracking settings from JSON.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

updateSettingsFromJson(settings, jsonData)
@NonNull BarcodeTrackingSettings updateSettingsFromJson(
        @NonNull BarcodeTrackingSettings settings,
        @NonNull String jsonData)

Added in version 6.1.0

Takes existing barcode tracking settings and updates them by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

basicOverlayFromJson(mode, jsonData)
@NonNull BarcodeTrackingBasicOverlay basicOverlayFromJson(
        @NonNull BarcodeTracking mode,
        @NonNull String jsonData)

Added in version 6.1.0

Deserializes a barcode tracking basic overlay from JSON.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

updateBasicOverlayFromJson(overlay, jsonData)
@NonNull BarcodeTrackingBasicOverlay updateBasicOverlayFromJson(
        @NonNull BarcodeTrackingBasicOverlay overlay,
        @NonNull String jsonData)

Added in version 6.1.0

Takes an existing barcode tracking basic overlay and updates it by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

advancedOverlayFromJson(mode, jsonData)
@NonNull BarcodeTrackingAdvancedOverlay advancedOverlayFromJson(
        @NonNull BarcodeTracking mode,
        @NonNull String jsonData)

Added in version 6.3.0

Deserializes a barcode tracking advanced overlay from JSON.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.

updateAdvancedOverlayFromJson(overlay, jsonData)
@NonNull BarcodeTrackingAdvancedOverlay updateAdvancedOverlayFromJson(
        @NonNull BarcodeTrackingAdvancedOverlay overlay,
        @NonNull String jsonData)

Added in version 6.3.0

Takes an existing barcode tracking advanced overlay and updates it by deserializing new or changed properties from JSON. See Updating from JSON for details of how updates are being done.

An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.