Frame Source Deserializer

Defined in package com.scandit.datacapture.core.source.serialization

Warning

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

FrameSourceDeserializer
class FrameSourceDeserializer

Added in version 6.1.0

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

FrameSourceDeserializer()
FrameSourceDeserializer(@NonNull List<@NonNull DataCaptureModeDeserializer> modeDeserializers)

Added in version 6.1.0

Creates a new deserializer object.

listener
@NonNull FrameSourceDeserializerListener getListener()
void setListener(@NonNull FrameSourceDeserializerListener 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.

frameSourceFromJson(jsonData)
@NonNull FrameSource frameSourceFromJson(@NonNull String jsonData)

Added in version 6.1.0

Deserializes a frame source from JSON.

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

updateFrameSourceFromJson(frameSource, jsonData)
@NonNull FrameSource updateFrameSourceFromJson(@NonNull FrameSource frameSource,
        @NonNull String jsonData)

Added in version 6.1.0

Takes an existing frame source 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.

updateFrameSourceFromJsonValue(frameSource, json)
@NonNull FrameSource updateFrameSourceFromJsonValue(
        @NonNull FrameSource frameSource,
        @NonNull JsonValue json)

Added in version 6.10.0

Takes an existing frame source 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.

cameraSettingsFromJson(jsonData)
@NonNull CameraSettings cameraSettingsFromJson(@NonNull String jsonData)

Added in version 6.1.0

Deserializes camera settings from JSON.

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

updateCameraSettingsFromJson(settings, jsonData)
@NonNull CameraSettings updateCameraSettingsFromJson(
        @NonNull CameraSettings settings,
        @NonNull String jsonData)

Added in version 6.1.0

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