xsdata.codegen.utils module¶
-
class
xsdata.codegen.utils.
ClassUtils
[source]¶ Bases:
object
General reusable utils methods that didn’t fit anywhere else.
-
classmethod
copy_attributes
(source, target, extension)[source]¶ Copy the attributes and inner classes from the source class to the target class and remove the extension that links the two classes together.
The new attributes are prepended in the list unless if they are supposed to be last in a sequence.
-
classmethod
copy_group_attributes
(source, target, attr)[source]¶ Copy the attributes and inner classes from the source class to the target class and remove the group attribute that links the two classes together.
-
classmethod
copy_extensions
(source, target, extension)[source]¶ Copy the extensions from the source class to the target class and merge the restrictions from the extension that linked the two classes together.
-
classmethod
clone_attribute
(attr, restrictions, prefix=None)[source]¶ Clone the given attribute and merge its restrictions with the given instance.
Prepend the given namespace prefix to the attribute name if available.
- Parameters
attr (
Attr
) –restrictions (
Restrictions
) –
- Return type
-
classmethod