瀏覽代碼

Added another overloaded FromJsonInstance() method.

Brucey 5 年之前
父節點
當前提交
9b3afa7541
共有 1 個文件被更改,包括 10 次插入0 次删除
  1. 10 0
      jconv.mod/jconv.bmx

+ 10 - 0
jconv.mod/jconv.bmx

@@ -184,6 +184,16 @@ Type TJConv
 		Return FromJson(json, typeId, obj)
 	End Method
 
+	Rem
+	bbdoc: Deserializes the specified JSON instance into an object of the specified type.
+	returns: The deserialized object.
+	End Rem
+	Method FromJsonInstance:Object(json:TJSON, typeName:String)
+		Local typeId:TTypeId = TTypeId.ForName(typeName)
+		
+		Return FromJson(json, typeId, Null)
+	End Method
+
 	Method FromJson:Object(txt:String, typeId:TTypeId, obj:Object)
 		Local error:TJSONError
 		Local json:TJSON = TJSON.Load(txt, 0, error)