from_json


Description:

[ CCode ( cname = "gdata_parsable_new_from_json" ) ]
[ Version ( since = "0.15.0" ) ]
public static Parsable from_json (Type parsable_type, string json, int length) throws Error

Creates a new Parsable subclass (of the given parsable_type) from the given json.

An object of the given parsable_type is created, and its parse_json and post_parse_json class functions called on the JSON node obtained from json. post_parse_json is called once on the root node, while parse_json is called for each of the node's members.

If length is -1, json will be assumed to be nul-terminated.

If an error occurs during parsing, a suitable error from ParserError will be returned.

Parameters:

parsable_type

the type of the class represented by the JSON

json

the JSON for just the parsable object

length

the length of json, or -1

Returns:

a new Parsable, or null; unref with unref




2022 vala-language.org