Einhugur JSON III Serialization Framework for Xojo

JSONSerializerIII.DeSerialize Method

De-serialize's a class structure

DeSerialize(
   item as Object,
   rootName as String,
   jsonDoc as JSONDocument)

Parameters

item
The object to de-serialize into
rootName
Name of the root. This can be empty string if package root is not named.
jsonDoc
The json document to be de-serialized.

Remarks

All classes that are de-serialized must have a default constructor that has no parameters.

In this example here we needed to add Customer and Address as known types as they were serialized as Polymorphic objects instead of strongly typed.


s = new JSONSerializationIII.JSONSerializerIII()
s.AddKnownClass(GetTypeInfo(Customer))
s.AddKnownClass(GetTypeInfo(Address))

Dim deserializedFacility as Facility = new Facility()

s.DeSerialize(deserializedFacility,"Facility”,jsonDoc)


See Also

JSONSerializerIII Class