Label Capture Deserializer
Defined in package com.scandit.datacapture.label.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.
- LabelCaptureDeserializer
class LabelCaptureDeserializer : DataCaptureModeDeserializer
Added in version 6.4.0
A deserializer to construct label capture from JSON. For most use cases it is enough to use LabelCapture.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.
- LabelCaptureDeserializer()
LabelCaptureDeserializer()Added in version 6.4.0
Creates a new deserializer object.
- listener
var listener: LabelCaptureDeserializerListener?
Added in version 6.4.0
The object informed about deserialization events.
- warnings
val warnings: List<String>
Added in version 6.4.0
The warnings produced during deserialization, for example which properties were not used during deserialization.
- modeFromJson(dataCaptureContext, jsonData)
fun modeFromJson(dataCaptureContext: DataCaptureContext, jsonData: String): LabelCapture
Added in version 6.4.0
Deserializes label 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)
fun updateModeFromJson(mode: LabelCapture, jsonData: String): LabelCapture
Added in version 6.4.0
Takes an existing label 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)
fun settingsFromJson(jsonData: String): LabelCaptureSettings
Added in version 6.4.0
Deserializes label 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)
fun updateSettingsFromJson(settings: LabelCaptureSettings, jsonData: String): LabelCaptureSettings
Added in version 6.4.0
Takes existing label 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.
- basicOverlayFromJson(mode, jsonData)
fun basicOverlayFromJson(mode: LabelCapture, jsonData: String): LabelCaptureBasicOverlay
Added in version 6.4.0
Deserializes a label capture 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)
fun updateBasicOverlayFromJson(overlay: LabelCaptureBasicOverlay, jsonData: String): LabelCaptureBasicOverlay
Added in version 6.4.0
Takes an existing label capture overlay 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.
- advancedOverlayFromJson(mode, jsonData)
fun advancedOverlayFromJson(mode: LabelCapture, jsonData: String): LabelCaptureAdvancedOverlay
Added in version 6.16.0
Deserializes a label capture 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)
fun updateAdvancedOverlayFromJson(overlay: LabelCaptureAdvancedOverlay, jsonData: String): LabelCaptureAdvancedOverlay
Added in version 6.16.0
Takes an existing label capture advanced overlay 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.
- validationFlowOverlayFromJson(mode, jsonData)
fun validationFlowOverlayFromJson(mode: LabelCapture, jsonData: String): LabelCaptureValidationFlowOverlay
Added in version 7.5.0
Deserializes a label capture validation flow overlay from JSON.
An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.
- updateValidationFlowOverlayFromJson(overlay, jsonData)
fun updateValidationFlowOverlayFromJson(overlay: LabelCaptureValidationFlowOverlay, jsonData: String): LabelCaptureValidationFlowOverlay
Added in version 7.5.0
Takes an existing label capture validation flow overlay 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.
- adaptiveRecognitionOverlayFromJson(mode, jsonData)
fun adaptiveRecognitionOverlayFromJson(mode: LabelCapture, jsonData: String): LabelCaptureAdaptiveRecognitionOverlay
Added in version 8.1.0
Deserializes a label capture adaptive recognition overlay from JSON.
An exception is thrown if the provided JSON does not contain required properties or contains properties of the wrong type.
- updateAdaptiveRecognitionOverlayFromJson(overlay, jsonData)
fun updateAdaptiveRecognitionOverlayFromJson( overlay: LabelCaptureAdaptiveRecognitionOverlay, jsonData: String): LabelCaptureAdaptiveRecognitionOverlay
Added in version 8.1.0
Takes an existing label capture adaptive recognition overlay 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.