JSONDeserializer
public class JSONDeserializer<T> where T : JSONModel
Undocumented
-
Finds the internal dictionary in
dict
as thedesignatedPath
specified, and map it to a ModeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func deserializeFrom(dict: [String : Any]?, designatedPath: String? = nil) -> T?
-
Finds the internal JSON field in
json
as thedesignatedPath
specified, and converts it to ModeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func deserializeFrom(json: String?, designatedPath: String? = nil) -> T?
-
Finds the internal JSON field in
array
as thedesignatedPath
specified, and converts it to ModeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func deserializeFrom(array: [Any]?, designatedPath: String? = nil) -> T?
-
Finds the internal dictionary in
dict
as thedesignatedPath
specified, and use it to reassign an exist modeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func update(object: inout T, from dict: [String : Any]?, designatedPath: String? = nil)
-
Finds the internal JSON field in
json
as thedesignatedPath
specified, and use it to reassign an exist modeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func update(object: inout T, from json: String?, designatedPath: String? = nil)
-
Finds the internal JSON field in
array
as thedesignatedPath
specified, and use it to reassign an exist modeldesignatedPath
is a string likeresult.data.orderInfo
, which each element split by.
represents key of each layer, or nilDeclaration
Swift
public static func update(object: inout T, from array: [Any]?, designatedPath: String? = nil)
-
if the JSON field found by
designatedPath
injson
is representing a array, such as[{...}, {...}, {...}]
, this method converts it to a Models arrayDeclaration
Swift
public static func deserializeModelArrayFrom(json: String?, designatedPath: String? = nil) -> [T?]?
-
if the JSON field found by
designatedPath
inobject
is representing a array, such as[{...}, {...}, {...}]
, this method converts it to a Models arrayDeclaration
Swift
public static func deserializeModelArrayFrom(dict: [AnyHashable : Any]?, designatedPath: String? = nil) -> [T?]?
-
mapping raw array to Models array
Declaration
Swift
public static func deserializeModelArrayFrom(array: [Any]?, designatedPath: String? = nil) -> [T?]?