xsdata.codegen.handlers.attribute_type module¶
-
class
xsdata.codegen.handlers.attribute_type.
AttributeTypeHandler
(container, dependencies=<factory>)[source]¶ Bases:
xsdata.codegen.mixins.HandlerInterface
Minimize class attributes complexity by filtering and flattening types.
- Parameters
container (
ContainerInterface
) –dependencies (
Dict
) –
-
container
: xsdata.codegen.mixins.ContainerInterface¶
-
dependencies
: Dict¶
-
process
(target)[source]¶ Process the given class attributes and their types.
Ensure all types are unique.
- Parameters
target (
Class
) –
-
process_type
(target, attr, attr_type)[source]¶ Process attribute type, split process for xml schema and user defined types.
Ignore forward references to inner classes.
-
classmethod
process_native_type
(attr, attr_type)[source]¶ Reset attribute type if the attribute has a pattern restriction as they are not yet supported.
-
find_dependency
(attr_type)[source]¶ Find dependency for the given attribute.
- Avoid conflicts by search in order:
Non element/complexType
Non abstract
anything
-
process_inner_type
(target, attr, attr_type)[source]¶ Process an attributes type that depends on an inner type.
If there is a matching simple type inner class copy the inner type attribute properties.
-
process_dependency_type
(target, attr, attr_type)[source]¶ Process an attributes type that depends on any global type.
- Steps:
Reset absent or dummy attribute types with a warning.
Copy attribute properties from a simple type.
Set circular flag for the rest non enumerations.
-
classmethod
copy_attribute_properties
(source, target, attr, attr_type)[source]¶ Replace the given attribute type with the types of the single field source class.
Ignore enumerations and gracefully handle dump types with no attributes.
-
is_circular_dependency
(source, target, seen)[source]¶ Check if any source dependencies recursively match the target class.
-
cached_dependencies
(source)[source]¶ Returns from cache the source class dependencies as a collection of qualified names.