Interface IJSONReadable
Denotes a CLR type-safe entity (class or struct) that can directly read itself from IJSONDataObject which is supplied by JSON parser. This mechanism bypasses all of the reflection/dynamic code. This approach may be far more performant for some classes that need to de-serialize their state/data from JSON format, than relying on general-purpose JSON serializer that can deserialize any type but is slower. The particular type has to be allocated first, then it's instance can be hydrated with data/state using this method
Namespace: Azos.Serialization.JSON
Assembly: Azos.dll
Syntax
public interface IJSONReadable
Methods
ReadAsJSON(IJSONDataObject)
Reads entitie's data/state from low-level IJSONDataObject which is supplied right by JSONParser. An implementer may elect to throw various types of exceptions to signal such conditions as: unknown key map, or too many fields not supplied etc.
Declaration
void ReadAsJSON(IJSONDataObject data)
Parameters
Type | Name | Description |
---|---|---|
IJSONDataObject | data | JSONParser-supplied object |