xsdata.codegen.validator module¶
-
class
xsdata.codegen.validator.
ClassValidator
(container)[source]¶ Bases:
object
Run validations against the class container in order to remove or merge invalid or redefined types.
- Parameters
container (
ClassContainer
) –
-
container
: xsdata.codegen.container.ClassContainer¶
-
classmethod
process
(container)[source]¶ Static entry point for container validation.
- Parameters
container (
ClassContainer
) –
-
validate
()[source]¶ Remove if possible classes with the same qualified name.
- Steps:
Remove classes with missing extension type.
Handle duplicate types.
Mark strict types.
-
remove_invalid_classes
(classes)[source]¶ Remove from the given class list any class with missing extension type.
-
classmethod
handle_duplicate_types
(classes)[source]¶ Handle classes with same namespace, name that are derived from the same xs type.
-
classmethod
merge_redefined_type
(source, target)[source]¶ Copy any attributes and extensions to redefined types from the original definitions.
Redefined inheritance is optional search for self references in extensions and attribute groups.
-
classmethod
select_winner
(candidates)[source]¶ Returns the index of the class that will survive the duplicate process.
Classes that were extracted from in xs:override/xs:redefined containers have priority, otherwise pick the last in the list.
-
classmethod
find_circular_extension
(target)[source]¶ Search for any target class extensions that is a circular reference.