Example #1
0
    def process(cls, container: ClassContainer, config: GeneratorConfig):
        """Iterate through all classes and run the sanitizer procedure."""

        sanitizer = cls(container, config)

        collections.apply(container.iterate(), sanitizer.process_class)

        sanitizer.resolve_conflicts()
Example #2
0
    def select_classes(cls, container: ClassContainer) -> List[Class]:
        """
        Return the qualified classes for code generation.

        Return all if no classes are derived from xs:element or
        xs:complexType.
        """

        classes = list(container.iterate())
        if any(item.is_complex for item in classes):
            classes = list(
                filter(
                    lambda x: x.is_enumeration or
                    (x.is_complex and not x.strict_type),
                    classes,
                ))

        cls.validate_references(classes)

        return classes
Example #3
0
    def process(cls, container: ClassContainer):
        """Iterate through all classes and run the sanitizer procedure."""

        sanitizer = cls(container)

        collections.apply(container.iterate(), sanitizer.process_class)