SparkScan Deserializer

Defined in package com.scandit.datacapture.barcode.spark.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.

SparkScanDeserializer
class SparkScanDeserializer

Added in version 6.16.0

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

SparkScanDeserializer()
SparkScanDeserializer()

Added in version 6.16.0

Creates a new deserializer object.

listener
var listener: SparkScanDeserializerListener?

Added in version 6.16.0

The object informed about deserialization events.

modeFromJson(dataCaptureContext, jsonData)
fun modeFromJson(dataCaptureContext: DataCaptureContext,
        jsonData: String): SparkScan

Added in version 6.16.0

Deserializes SparkScan 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)
fun updateModeFromJson(mode: SparkScan,
        jsonData: String): SparkScan

Added in version 6.16.0

Takes an existing SparkScan 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)
fun settingsFromJson(jsonData: String): SparkScanSettings

Added in version 6.16.0

Deserializes SparkScan 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)
fun updateSettingsFromJson(settings: SparkScanSettings,
        jsonData: String): SparkScanSettings

Added in version 6.16.0

Takes existing SparkScan 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.