GData.Parsable¶
- Subclasses:
GData.APPCategories
,GData.Author
,GData.Category
,GData.DocumentsMetadata
,GData.DocumentsProperty
,GData.Entry
,GData.Feed
,GData.GContactCalendar
,GData.GContactEvent
,GData.GContactExternalID
,GData.GContactJot
,GData.GContactLanguage
,GData.GContactRelation
,GData.GContactWebsite
,GData.GDEmailAddress
,GData.GDIMAddress
,GData.GDName
,GData.GDOrganization
,GData.GDPhoneNumber
,GData.GDPostalAddress
,GData.GDReminder
,GData.GDWhen
,GData.GDWhere
,GData.GDWho
,GData.Generator
,GData.Link
,GData.MediaCategory
,GData.MediaContent
,GData.MediaCredit
,GData.MediaThumbnail
,GData.YouTubeState
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Specifies whether the object was constructed by parsing XML or manually. |
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class GData.Parsable(**kwargs)¶
- Bases:
- Abstract:
Yes
- Structure:
All the fields in the
GData.Parsable
structure are private and should never be accessed directly.New in version 0.3.0.
- classmethod new_from_json(parsable_type, json, length)¶
- Parameters:
parsable_type (
GObject.GType
) – the type of the class represented by the JSONjson (
str
) – the JSON for just the parsable objectlength (
int
) – the length of json, or -1
- Raises:
- Returns:
a new
GData.Parsable
, orNone
; unref withGObject.Object.unref
()- Return type:
Creates a new
GData.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
GData.ParserError
will be returned.New in version 0.15.0.
- classmethod new_from_xml(parsable_type, xml, length)¶
- Parameters:
parsable_type (
GObject.GType
) – the type of the class represented by the XMLxml (
str
) – the XML for just the parsable object, with full namespace declarationslength (
int
) – the length of xml, or -1
- Raises:
- Returns:
a new
GData.Parsable
, orNone
; unref withGObject.Object.unref
()- Return type:
Creates a new
GData.Parsable
subclass (of the given parsable_type) from the given xml.An object of the given parsable_type is created, and its pre_parse_xml, parse_xml and post_parse_xml class functions called on the XML tree obtained from xml. pre_parse_xml and post_parse_xml are called once each on the root node of the tree, while parse_xml is called for each of the child nodes of the root node.
If length is -1, xml will be assumed to be null-terminated.
If an error occurs during parsing, a suitable error from
GData.ParserError
will be returned.New in version 0.4.0.
- get_content_type()¶
- Returns:
the parsable’s content type
- Return type:
Returns the content type upon which the
GData.Parsable
is built. For example,application/atom+xml
orapplication/json
.New in version 0.17.7.
- get_json()¶
-
Builds a JSON representation of the
GData.Parsable
in its current state, such that it could be inserted on the server. The JSON is valid for stand-alone use.New in version 0.15.0.
- get_xml()¶
-
Builds an XML representation of the
GData.Parsable
in its current state, such that it could be inserted on the server. The XML is guaranteed to have all its namespaces declared properly in a self-contained fashion, and is valid for stand-alone use.New in version 0.4.0.
- do_get_json(builder) virtual¶
- Parameters:
builder (
Json.Builder
) –
- do_get_xml(xml_string) virtual¶
- Parameters:
xml_string (
GLib.String
) –
- do_parse_json(reader, *user_data) virtual¶
- Parameters:
reader (
Json.Reader
) –
- Return type:
- do_parse_xml(doc, node, *user_data) virtual¶
- Parameters:
doc (
libxml2.Doc
) –node (
libxml2.Node
) –
- Return type:
- do_pre_get_xml(xml_string) virtual¶
- Parameters:
xml_string (
GLib.String
) –
- do_pre_parse_xml(doc, root_node, *user_data) virtual¶
- Parameters:
doc (
libxml2.Doc
) –root_node (
libxml2.Node
) –
- Return type: