/// <summary> /// Creates a JSON representation for an object with serialization manager override on this call /// </summary> /// <param name="obj">The object to be serialized.</param> /// <param name="manager">The <see cref="SerializationManager"/> to control advanced JSON serialization.</param> /// <returns>The serialized JSON string.</returns> public static string ToJSON(object obj, SerializationManager manager) { return(ToJSON(obj, Parameters, manager)); }
/// <summary> /// Creates an object from the JSON with parameter override on this call. /// </summary> /// <param name="json">The JSON string to be deserialized.</param> /// <param name="type">The type of the expected object after deserialization.</param> /// <param name="param">The <see cref="JSONParameters"/> to control deserialization.</param> /// <param name="manager">The <see cref="SerializationManager"/> to control advanced JSON deserialization.</param> /// <returns>The deserialized object.</returns> public static object ToObject(string json, Type type, JSONParameters param, SerializationManager manager) { return(new JsonDeserializer(param, manager).ToObject(json, type)); }
/// <summary> /// Deep-copies an object i.e. clones to a new object. /// </summary> /// <typeparam name="T">The type of the object to be copied.</typeparam> /// <param name="obj">The object to be deep copied.</param> /// <param name="param">The <see cref="JSONParameters"/> to control deserialization.</param> /// <param name="manager">The <see cref="SerializationManager"/> to control advanced JSON deserialization.</param> /// <returns>The copy of <paramref name="obj"/>.</returns> public static T DeepCopy <T>(T obj, JSONParameters param, SerializationManager manager) { return(new JsonDeserializer(param, manager).ToObject <T>(ToJSON(obj))); }
/// <summary> /// Creates a typed generic object from the JSON with parameter and serialization manager override on this call. /// </summary> /// <typeparam name="T">The type of the expected object after deserialization.</typeparam> /// <param name="json">The JSON string to be deserialized.</param> /// <param name="param">The <see cref="JSONParameters"/> to control deserialization.</param> /// <param name="manager">The <see cref="SerializationManager"/> to control advanced JSON deserialization.</param> /// <returns>The deserialized object of type <typeparamref name="T"/>.</returns> public static T ToObject <T>(string json, JSONParameters param, SerializationManager manager) { return(new JsonDeserializer(param, manager).ToObject <T>(json)); }