Json.Path¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new() | 
| class | query(expression, root) | 
| compile(expression) | |
| match(root) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Json.Path(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - Structure: - Json.PathClass- The - JsonPathstructure is an opaque object whose members cannot be directly accessed except through the provided API.- New in version 0.14. - 
classmethod new()¶
- Returns: - the newly created - Json.Pathinstance. Use- GObject.Object.unref() to free the allocated resources when done- Return type: - Json.Path- Creates a new - Json.Pathinstance.- Once created, the - Json.Pathobject should be used with- Json.Path.compile() and- Json.Path.match().- New in version 0.14. 
 - 
classmethod query(expression, root)¶
- Parameters: - Raises: - Returns: - a newly-created - Json.Nodeof type- Json.NodeType.ARRAYcontaining an array of matching- Json.Nodes. Use- Json.Node.unref() when done- Return type: - Queries a JSON tree using a JSONPath expression. - This function is a simple wrapper around - Json.Path.new(),- Json.Path.compile() and- Json.Path.match(). It implicitly creates a- Json.Pathinstance, compiles expression and matches it against the JSON tree pointed by root.- New in version 0.14. 
 - 
compile(expression)¶
- Parameters: - expression ( - str) – a JSONPath expression- Raises: - GLib.Error- Returns: - Trueon success; on error, error will be set with the %JSON_PATH_ERROR domain and a code from the- Json.PathErrorenumeration, and- Falsewill be returned- Return type: - bool- Validates and decomposes expression. - A JSONPath expression must be compiled before calling - Json.Path.match().- New in version 0.14. 
 - 
match(root)¶
- Parameters: - root ( - Json.Node) – a- Json.Node- Returns: - a newly-created - Json.Nodeof type- Json.NodeType.ARRAYcontaining an array of matching- Json.Nodes. Use- Json.Node.unref() when done- Return type: - Json.Node- Matches the JSON tree pointed by root using the expression compiled into the - Json.Path.- The matching - Json.Nodeswill be copied into a- Json.Arrayand returned wrapped in a- Json.Node.- New in version 0.14. 
 
- 
classmethod