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.

System.Object
  Westwind.Web.JsonSerializers.WestwindJsonSerializer
public class WestwindJsonSerializer : object, IJSONSerializer

Class Members

MemberDescription

Constructor

Force a master Serializer to be passed for settings

SerializeFields

Determines whether fields are serialized

Deserialize

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)

Deserialize

Deserializes JSON string into a specified type value.

public TType Deserialize(string jsonText)

ParseArray

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)

ParseNumber

public object ParseNumber(string value,     Type valueType)

public bool ParseNumber(string value,     ref object result)

ParseString

Parses a JSON string into a string value

public string ParseString(string value)

Serialize

Serializes a .NET object reference into a JSON string.

public sealed string Serialize(object value)

WriteValue

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

public void WriteValue(StringBuilder sb,     object val)

DateSerializationMode

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.

FormatJsonOutput

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

Requirements

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

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