Deserializes an ABL class-based object from the specified JSON stream.
Return type: Progress.Lang.Object class
Access: PUBLIC
Applies to: Progress.IO.JsonSerializer class
The following code sample deserializes the object in myFileStream to the object reference myObj:
DEFINE VARIABLE myFileOutStream AS Progress.IO.FileOutputStream. DEFINE VARIABLE myFileInStream AS Progress.IO.FileInputStream. DEFINE VARIABLE mySerializer AS Progress.IO.JsonSerializer. DEFINE VARIABLE myObj AS Acme.MyClass. myObj = NEW Acme.MyClass(). mySerializer = NEW Progress.IO.JsonSerializer(FALSE). /* Serialize object */ myFileOutStream = NEW Progress.IO.FileOutputStream("MyClass.json"). mySerializer:Serialize(myObj, myFileOutStream). myFileOutStream:Close(). /* Deserialize object */ myFileInStream = NEW Progress.IO.FileInputStream("MyClass.json"). myObj = CAST(mySerializer:Deserialize(myFileInStream), Acme.MyClass). myFileInStream:Close(). |