Class WestwindJsonSerializer

More text is a basic JSON serializer and deserializer that deals with standard .NET types. Unlike the MS Ajax JSONSerializer parser this parser support serialization and deserialization without explicit type markup in the JSON resulting in a simpler two-way model.

The inbound model for complex types is based on Reflection parsing of properties.

public class WestwindJsonSerializer : object, IJSONSerializer

Class Members



Force a master Serializer to be passed for settings


Determines whether fields are serialized


Takes a JSON string and attempts to create a .NET object from this structure. An input type is required and any type that is serialized to must support a parameterless constructor.

public sealed object Deserialize(string jsonText,     Type valueType)


Deserializes JSON string into a specified type value.

public TType Deserialize(string jsonText)


Parses a JSON array string to its underlying array type. Requires: - Array must be of a single element type (ie. an object, or string or decimal)

public object ParseArray(StringReader reader,     Type arrayType)


public object ParseNumber(string value,     Type valueType)

public bool ParseNumber(string value,     ref object result)


Parses a JSON string into a string value

public string ParseString(string value)


Serializes a .NET object reference into a JSON string.

public sealed string Serialize(object value)


Serialization routine that takes any value and serializes it into JSON.

public void WriteValue(StringBuilder sb,     object val)


Encodes Dates as a JSON string value that is compatible with MS AJAX and is safe for JSON validators. If false serializes dates as new Date() expression instead.


Determines if there are line breaks inserted into the JSON to make it more easily human readable.


Namespace: Westwind.Web.JsonSerializers
Assembly: westwind.web.dll

© West Wind Technologies, 1996-2016 • Updated: 12/12/15
Comment or report problem with topic