ID Capture Deserializer

Defined in package com.scandit.datacapture.id.capture.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.

IdCaptureDeserializer
class IdCaptureDeserializer : DataCaptureModeDeserializer

Added in version 6.6.0

A deserializer to construct id capture from JSON. For most use cases it is enough to use IdCapture.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.

IdCaptureDeserializer()
IdCaptureDeserializer()

Added in version 6.6.0

Creates a new deserializer object.

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

Added in version 6.6.0

The object informed about deserialization events.

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

Added in version 6.6.0

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

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

Added in version 6.6.0

Deserializes id capture 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 IdCapture updateModeFromJson(@NonNull IdCapture mode,
        @NonNull String jsonData)

Added in version 6.22.0

Takes an existing ID capture and updates it by deserializing new or changed properties from JSON.

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

settingsFromJson(jsonData)
@NonNull IdCaptureSettings settingsFromJson(@NonNull String jsonData)

Added in version 6.6.0

Deserializes id capture 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 IdCaptureSettings updateSettingsFromJson(@NonNull IdCaptureSettings settings,
        @NonNull String jsonData)

Added in version 6.6.0

Takes existing id capture settings and updates them by deserializing new or changed properties from JSON.

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

overlayFromJson(mode, jsonData)
@NonNull IdCaptureOverlay overlayFromJson(@NonNull IdCapture mode,
        @NonNull String jsonData)

Added in version 6.6.0

Deserializes id capture overlay from JSON.

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

updateOverlayFromJson(overlay, jsonData)
@NonNull IdCaptureOverlay updateOverlayFromJson(
        @NonNull IdCaptureOverlay overlay,
        @NonNull String jsonData)

Added in version 6.6.0

Takes existing id capture overlay and updates them by deserializing new or changed properties from JSON.

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