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
: 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
(target, attr_type)[source]¶ Find dependency for the given attribute.
- Avoid conflicts by search in order:
Non element/complexType
Non abstract
anything
-
process_dependency_type
(target, attr, attr_type)[source]¶ Process user defined attribute types, split process between complex and simple types.
Reset absent attribute types with a warning.
Complex Type: xs:Element and xs:ComplexType Simple stype: the rest
-
classmethod
process_simple_dependency
(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.