C# Class JP.Utils.Data.Json.JsonParser

Show file Open project: JuniperPhoton/JP.Utils.UWP

Public Methods

Method Description
GetBooleanFromJsonObj ( IJsonValue obj, string propertyName, bool defaultValue = false ) : bool
GetJsonArrayFromJsonObj ( IJsonValue obj, string propertyName ) : JsonArray
GetJsonObjFromJsonObj ( IJsonValue obj, string propertyName ) : JsonObject
GetNullableNumberFromJsonObj ( IJsonValue obj, string propertyName, double defaultValue = null ) : double?
GetNumberFromJsonObj ( IJsonValue obj, string propertyName, double defaultValue ) : double
GetStringFromJsonObj ( IJsonValue obj, string propertyName, string defaultValue = null ) : string

Usage : like var token = JsonParser.GetStringFromJsonObj(json, "token");

Method Details

GetBooleanFromJsonObj() public static method

public static GetBooleanFromJsonObj ( IJsonValue obj, string propertyName, bool defaultValue = false ) : bool
obj IJsonValue
propertyName string
defaultValue bool
return bool

GetJsonArrayFromJsonObj() public static method

public static GetJsonArrayFromJsonObj ( IJsonValue obj, string propertyName ) : JsonArray
obj IJsonValue
propertyName string
return JsonArray

GetJsonObjFromJsonObj() public static method

public static GetJsonObjFromJsonObj ( IJsonValue obj, string propertyName ) : JsonObject
obj IJsonValue
propertyName string
return JsonObject

GetNullableNumberFromJsonObj() public static method

public static GetNullableNumberFromJsonObj ( IJsonValue obj, string propertyName, double defaultValue = null ) : double?
obj IJsonValue
propertyName string
defaultValue double
return double?

GetNumberFromJsonObj() public static method

public static GetNumberFromJsonObj ( IJsonValue obj, string propertyName, double defaultValue ) : double
obj IJsonValue
propertyName string
defaultValue double
return double

GetStringFromJsonObj() public static method

Usage : like var token = JsonParser.GetStringFromJsonObj(json, "token");
public static GetStringFromJsonObj ( IJsonValue obj, string propertyName, string defaultValue = null ) : string
obj IJsonValue
propertyName string
defaultValue string
return string