xsdata.utils.codegen module

class xsdata.utils.codegen.ClassUtils[source]

Bases: object

INCLUDES_NONE = 0
INCLUDES_SOME = 1
INCLUDES_ALL = 2
classmethod compare_attributes(source, target)[source]
classmethod sanitize_attributes(target)[source]
classmethod sanitize_attribute(attr)[source]
classmethod sanitize_restrictions(restrictions)[source]
classmethod sanitize_attribute_sequence(attrs, index)[source]

Reset the attribute at the given index if it has no siblings with the sequential restriction.

classmethod sanitize_attribute_name(attrs, index)[source]

Check if the attribute at the given index has a duplicate name and prepend if exists the attribute namespace.

classmethod merge_duplicate_attributes(target)[source]

Flatten duplicate attributes.

Remove duplicate fields in case of attributes or enumerations otherwise convert fields to lists.

classmethod copy_attributes(source, target, extension)[source]
classmethod clone_attribute(attr, restrictions, prefix=None)[source]
classmethod copy_inner_classes(source, target)[source]
classmethod create_default_attribute(item, extension)[source]
classmethod create_reference_attribute(source, qname)[source]
classmethod find_attribute(attrs, attr)[source]