|
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Apolyton.FastJson.Serialization
{
/// <summary>
/// Represents an interface for a custom type serializer.
/// </summary>
public interface ICustomTypeSerializer
{
/// <summary>
/// Gets the type for which serializer is responsible for.
/// </summary>
Type Type { get; }
/// <summary>
/// Gets the custom name of the type. Returns null, if default is to be taken.
/// </summary>
String TypeName { get; }
/// <summary>
/// Gets the bool which indicates whether the custom type serializer implements a serialization method.
/// </summary>
bool CanSerialize { get; }
/// <summary>
/// Gets the bool which indicates whether the custom type serializer implements a deserialization method.
/// </summary>
bool CanDeserialize { get; }
/// <summary>
/// Represents a serialization method which returns a json-value-string for the given data object.
/// </summary>
/// <example>
/// if (data != null) { return "Yes"; } else { return "No"; }
/// </example>
string Serialize (object data);
/// <summary>
/// Represents a serialization handler which returns a deserialized object for the given data string.
/// </summary>
/// <param name="data"></param>
/// <returns></returns>
/// <example>
/// if (jsonValueString == "Yes") { return true; } else { return false; }
/// </example>
object Deserialize(string jsonValueString);
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.