xsdata.resolver module¶
-
class
xsdata.resolver.
DependenciesResolver
(processed=<factory>, aliases=<factory>, imports=<factory>)[source]¶ Bases:
object
-
processed
: Dict[str, str] = None¶
-
aliases
: Dict[str, str] = None¶
-
imports
: List[Package] = None¶
-
class_list
: List[str] = None¶
-
class_map
: Dict[str, Class] = None¶
-
schema
: Schema = None¶
-
package
: str = None¶
-
process
(classes, schema, package)[source]¶ Process a list of classes for the given schema and package.
Reset aliases and imports from any previous runs keep the record of the processed class names
-
sorted_classes
()[source]¶ Return an iterator of classes property sorted for generation.
Keep track of the class names and their target package name for future classes. Also apply type aliases for the given process run.
-
resolve_imports
()[source]¶ Walk all the import class names and add type aliases for name collisions with the given list of classes and build a list of import packages.
- Return type
None
-
add_import
(name, package, alias)[source]¶ Create and append an import package to the list of imports, collect a map of aliases for when we process the list of classes to generate.
- Return type
None
-
add_package
(obj)[source]¶ Add the given class to the map of processed items indexed with the qname of the class and the schema target namespace.
eg {http://www.namespace/name}ClassName
- Return type
None
-
find_package
(prefix, name)[source]¶ Use the schema namespaces map to find the package where the requested class belongs to.
- Example:
Schema nsmap {“common”: “http://www.common/ns”}
Resolved processed {“{http://www.common/ns}address”: “source.package”}
Request for (common, address) will return source.package
- Return type
-
create_class_list
(classes)[source]¶ Use topology sort to return a flat list for all the dependencies.
-