XmlContext¶
- class xsdata.formats.dataclass.context.XmlContext(element_name_generator=<function return_input>, attribute_name_generator=<function return_input>, class_type='dataclasses')[source]¶
The service provider for binding operations metadata.
- Parameters
- fetch(clazz, parent_ns=None, xsi_type=None)[source]¶
Fetch the model metadata of the given dataclass type, namespace and xsi type.
- Parameters
- Return type
- find_types(qname)[source]¶
Find all classes that match the given xsi:type qname.
Ignores native schema types, xs:string, xs:float, xs:int, …
Rebuild cache if new modules were imported since last run
- find_type(qname)[source]¶
Return the most recently imported class that matches the given xsi:type qname.
- find_type_by_fields(field_names)[source]¶
Find a dataclass from all the imported modules that matches the given list of field names.
- find_subclass(clazz, qname)[source]¶
Compare all classes that match the given xsi:type qname and return the first one that is either a subclass or shares the same parent class as the original class.
- build(clazz, parent_ns=None)[source]¶
Fetch from cache or build the binding metadata for the given class and parent namespace.