Ext.NET  5.3.0
.NET Component Framework for Enterprise Level Apps
Ext.Net.JSON Class Reference

Convenience wrappers for Json.NET More...

Static Public Member Functions

static string Serialize (object obj, IList< JsonConverter > converters, IContractResolver resolver)
 Serializes the specified object to a Json object. More...
 
static string Serialize (object obj, JsonSerializerSettings settings)
 Serializes the specified object to a Json object. More...
 
static JRawValue JavaScriptSerialize (object obj, bool sourceFormatting=false)
 Serializes the object not as a JSON object, but a lowerCamelCased JavaScript object itself. Notice the result will NOT be a JSON-compliant value! More...
 
static object Deserialize (string value, Type type, IList< JsonConverter > converters, IContractResolver resolver)
 Serializes the Json object to a specific object. More...
 
static object Deserialize (string value, Type type, JsonSerializerSettings settings)
 Serializes the Json object to a specific object. More...
 
static string Serialize (object obj, IList< JsonConverter > converters)
 Serializes the specified object to a Json object. More...
 
static string Serialize (object obj, JsonConverter converter)
 Serializes the specified object to a Json object. More...
 
static string Serialize (object obj)
 Serializes the specified object to a Json object. More...
 
static string Serialize (object obj, IContractResolver resolver)
 Serializes the specified object to a Json object. More...
 
static object Deserialize (string value)
 Deserializes the specified object to a Json object. More...
 
static object Deserialize (string value, Type type)
 Deserializes the specified object to a Json object. More...
 
static object Deserialize (string value, Type type, IContractResolver resolver)
 Deserializes the specified object to a Json object. More...
 
static T Deserialize< T > (string value)
 Deserializes the specified object to a Json object. More...
 
static T Deserialize< T > (string value, IList< JsonConverter > converters)
 Deserializes the specified object to a Json object. More...
 
static T Deserialize< T > (string value, IContractResolver resolver)
 Deserializes the specified object to a Json object. More...
 
static T Deserialize< T > (string value, IList< JsonConverter > converters, IContractResolver resolver)
 Deserializes the specified object to a Json object. More...
 
static T Deserialize< T > (string value, JsonSerializerSettings settings)
 Deserializes the specified object to a Json object. More...
 
static XmlNode DeserializeXmlNode (string value)
 Deserializes the specified object to a Json object. More...
 
static string ToString (JToken token)
 
static string EnumToString (object val)
 Gets the string representation of the enum value, considering the JavaScriptMap attribute and also ConfigOption attribute's JsonMode when ToLowerCase and ToLowerCamelCase. More...
 
static object EnumParse (Type enumType, string value, bool ignoreCase=false)
 Gets the Enum representation of the specified string value, with the JavaScriptMap attribute taking precedence match over the enum name itself. It is always case-sensitive. If the enum's field has no JavaScriptMap attribute, the ordinary Enum name matching is used, considering JsonMode setting. More...
 

Properties

static JsonSerializerSettings GlobalSettings [get, set]
 
static JsonSerializerSettings RequestSettings [get, set]
 
static JsonSerializerSettings?? CurrentSettings [get]
 
static JsonSerializerSettings?? CopyCurrentSettings [get]
 
static List< JsonConverter > Converters [get]
 
static List< JsonConverter > DateMsConverters [get]
 
static List< JsonConverter > ScriptConverters [get]
 

Detailed Description

Convenience wrappers for Json.NET

Member Function Documentation

◆ Deserialize() [1/5]

static object Ext.Net.JSON.Deserialize ( string  value)
inlinestatic

Deserializes the specified object to a Json object.

Parameters
valueThe object to deserialize.
Returns
The deserialized object from the Json string.

◆ Deserialize() [2/5]

static object Ext.Net.JSON.Deserialize ( string  value,
Type  type 
)
inlinestatic

Deserializes the specified object to a Json object.

Parameters
valueThe object to deserialize.
typeThe Type of object being deserialized.
Returns
The deserialized object from the Json string.

◆ Deserialize() [3/5]

static object Ext.Net.JSON.Deserialize ( string  value,
Type  type,
IContractResolver  resolver 
)
inlinestatic

Deserializes the specified object to a Json object.

Parameters
valueThe object to deserialize.
typeThe Type of object being deserialized.
resolverThe IContractResolver object to customize serialization.
Returns
The deserialized object from the Json string.

◆ Deserialize() [4/5]

static object Ext.Net.JSON.Deserialize ( string  value,
Type  type,
IList< JsonConverter >  converters,
IContractResolver  resolver 
)
inlinestatic

Serializes the Json object to a specific object.

Parameters
valueJson object
typeObject's type
convertersA List of JsonConverter objects to customize deserialization.
resolverThe IContractResolver object to customize serialization.
Returns
Object

◆ Deserialize() [5/5]

static object Ext.Net.JSON.Deserialize ( string  value,
Type  type,
JsonSerializerSettings  settings 
)
inlinestatic

Serializes the Json object to a specific object.

Parameters
valueJson object
typeObject's type
settingsSerializer settings
Returns
Object

◆ Deserialize< T >() [1/5]

static T Ext.Net.JSON.Deserialize< T > ( string  value)
inlinestatic

Deserializes the specified object to a Json object.

Template Parameters
TThe type of the object to deserialize.
Parameters
valueThe object to deserialize.
Returns
The deserialized object from the Json string.

◆ Deserialize< T >() [2/5]

static T Ext.Net.JSON.Deserialize< T > ( string  value,
IContractResolver  resolver 
)
inlinestatic

Deserializes the specified object to a Json object.

Template Parameters
TThe type of the object to deserialize.
Parameters
valueThe object to deserialize.
resolverThe IContractResolver object to customize serialization.
Returns
The deserialized object from the Json string.

◆ Deserialize< T >() [3/5]

static T Ext.Net.JSON.Deserialize< T > ( string  value,
IList< JsonConverter >  converters 
)
inlinestatic

Deserializes the specified object to a Json object.

Template Parameters
TThe type of the object to deserialize.
Parameters
valueThe object to deserialize.
convertersA List of JsonConverter objects to customize serialization.
Returns
The deserialized object from the Json string.

◆ Deserialize< T >() [4/5]

static T Ext.Net.JSON.Deserialize< T > ( string  value,
IList< JsonConverter >  converters,
IContractResolver  resolver 
)
inlinestatic

Deserializes the specified object to a Json object.

Template Parameters
TThe type of the object to deserialize.
Parameters
valueThe object to deserialize.
convertersA List of JsonConverter objects to customize serialization.
resolverThe IContractResolver object to customize serialization.
Returns
The deserialized object from the Json string.

◆ Deserialize< T >() [5/5]

static T Ext.Net.JSON.Deserialize< T > ( string  value,
JsonSerializerSettings  settings 
)
inlinestatic

Deserializes the specified object to a Json object.

Template Parameters
TThe type of the object to deserialize.
Parameters
valueThe object to deserialize.
settingsSerializer settings
Returns
The deserialized object from the Json string.

◆ DeserializeXmlNode()

static XmlNode Ext.Net.JSON.DeserializeXmlNode ( string  value)
inlinestatic

Deserializes the specified object to a Json object.

Parameters
valueThe object to deserialize.
Returns
The deserialized object from the Json string.

◆ EnumParse()

static object Ext.Net.JSON.EnumParse ( Type  enumType,
string  value,
bool  ignoreCase = false 
)
inlinestatic

Gets the Enum representation of the specified string value, with the JavaScriptMap attribute taking precedence match over the enum name itself. It is always case-sensitive. If the enum's field has no JavaScriptMap attribute, the ordinary Enum name matching is used, considering JsonMode setting.

Parameters
enumTypeThe enum conversion wanted.
valueThe value to look for.
ignoreCaseWhether to ignore case of the enum/value names or consider exact match or JsonMode conversion.
Returns
The corresponding enum value matching the string.

If no JavaScriptMap is present, the enum match is case sensitive, It will look for the Enum type's ConfigOption attribute against the JsonMode setting, considering LowerCase and LowerCamelCase if present to compare the matches.

◆ EnumToString()

static string Ext.Net.JSON.EnumToString ( object  val)
inlinestatic

Gets the string representation of the enum value, considering the JavaScriptMap attribute and also ConfigOption attribute's JsonMode when ToLowerCase and ToLowerCamelCase.

Parameters
valThe enum to be mapped to string.
Returns
The string representation of the Enum value.

◆ JavaScriptSerialize()

static JRawValue Ext.Net.JSON.JavaScriptSerialize ( object  obj,
bool  sourceFormatting = false 
)
inlinestatic

Serializes the object not as a JSON object, but a lowerCamelCased JavaScript object itself. Notice the result will NOT be a JSON-compliant value!

If the result is going to be eval'd in JavaScript, setting sourceFormatting=true will break the generated code, unless line breaking sequences (\r and
) are properly replaced.

Parameters
obj
sourceFormatting
Returns

◆ Serialize() [1/6]

static string Ext.Net.JSON.Serialize ( object  obj)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
Returns
A Json string representation of the object.

◆ Serialize() [2/6]

static string Ext.Net.JSON.Serialize ( object  obj,
IContractResolver  resolver 
)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
resolverThe IContractResolver object to customize serialization.
Returns
A Json string representation of the object.

◆ Serialize() [3/6]

static string Ext.Net.JSON.Serialize ( object  obj,
IList< JsonConverter >  converters 
)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
convertersA List of JsonConverter objects to customize serialization.
Returns
A Json string representation of the object.

◆ Serialize() [4/6]

static string Ext.Net.JSON.Serialize ( object  obj,
IList< JsonConverter >  converters,
IContractResolver  resolver 
)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
convertersA List of JsonConverter objects to customize serialization.
resolverThe IContractResolver object to customize serialization.
Returns
A Json string representation of the object.

◆ Serialize() [5/6]

static string Ext.Net.JSON.Serialize ( object  obj,
JsonConverter  converter 
)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
converterA JsonConverter object to customize serialization.
Returns
A Json string representation of the object.

◆ Serialize() [6/6]

static string Ext.Net.JSON.Serialize ( object  obj,
JsonSerializerSettings  settings 
)
inlinestatic

Serializes the specified object to a Json object.

Parameters
objThe object to serialize.
settingsSerializer settings
Returns
A Json string representation of the object.

◆ ToString()

static string Ext.Net.JSON.ToString ( JToken  token)
inlinestatic

Parameters
token
Returns

Property Documentation

◆ Converters

List<JsonConverter> Ext.Net.JSON.Converters
staticget

◆ CopyCurrentSettings

JsonSerializerSettings?? Ext.Net.JSON.CopyCurrentSettings
staticget

◆ CurrentSettings

JsonSerializerSettings?? Ext.Net.JSON.CurrentSettings
staticget

◆ DateMsConverters

List<JsonConverter> Ext.Net.JSON.DateMsConverters
staticget

◆ GlobalSettings

JsonSerializerSettings Ext.Net.JSON.GlobalSettings
staticgetset

◆ RequestSettings

JsonSerializerSettings Ext.Net.JSON.RequestSettings
staticgetset

◆ ScriptConverters

List<JsonConverter> Ext.Net.JSON.ScriptConverters
staticget


The documentation for this class was generated from the following file: