Einhugur JSON II Serialization Framework for Xojo

JSONSerializerII.Serialize Method

Serialize's a class structure

Serialize(
   item as Object,
   rootName as String) as JSONObject

Parameters

item
The item to be serialized
rootName
Name of the root. This can be empty string if package root is not named.

Returns

JSONObject
Returns JSON object with the serialized class structure.

Remarks

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


// Serialize our data
// ------------------------------------------------------------------
var s as JSONSerializationII.JSONSerializerII = new JSONSerializationII.JSONSerializerII()
var doc as EinhugurJSON.JSONObject = s.Serialize(facility1,"Facility")
// ------------------------------------------------------------------



This method can throw SerializationException.

See Also

JSONSerializerII Class