Parser Deserializer

Defined in framework ScanditParser

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 parser have to be called on the same thread.

SDCParserDeserializer
@interface SDCParserDeserializer : NSObject <SDCDataCaptureComponentDeserializer>

Added in version 6.3.0

A deserializer to construct a parser from JSON. For most use cases it is enough to use SDCParser.parserFromJSONString:context:error: 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.

+ parserDeserializer
+ (instancetype)parserDeserializer

Added in version 6.3.0

Creates a new deserializer object.

delegate
@property (nonatomic, weak, nullable) id<SDCParserDeserializerDelegate> delegate

Added in version 6.3.0

The object informed about deserialization events.

warnings
@property (nonatomic, nonnull, readonly) NSArray<NSString *> *warnings

Added in version 6.3.0

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

- parserFromJSONString:context:error:
- (nullable SDCParser *)parserFromJSONString:(nonnull NSString *)JSONString
                                     context:(nonnull SDCDataCaptureContext *)context
                                       error:(NSError **)error

Added in version 6.3.0

Deserializes a parser from JSON.

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

- updateParser:fromJSONString:error:
- (nullable SDCParser *)updateParser:(nonnull SDCParser *)parser
                      fromJSONString:(NSString *)JSONString
                               error:(NSError **)error

Added in version 6.3.0

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

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