xsdata.builder module¶
-
class
xsdata.builder.
ClassBuilder
(schema, package)[source]¶ Bases:
object
-
schema
: Schema = None¶
-
package
: str = None¶
-
build_class
(obj)[source]¶ Build and return a class instance.
- Parameters
obj (
ElementBase
) –- Return type
-
build_class_attributes
(obj, target)[source]¶ Build the target class attributes from the given ElementBase children.
- Parameters
obj (
ElementBase
) –target (
Class
) –
-
build_class_extensions
(obj, target)[source]¶ Build the item class extensions from the given ElementBase children.
- Parameters
obj (
ElementBase
) –target (
Class
) –
-
element_children
(obj, restrictions=None)[source]¶ Recursively find and return all child elements that are qualified to be class attributes.
- Parameters
obj (
ElementBase
) –restrictions (
Optional
[Restrictions
]) –
- Return type
-
element_namespace
(obj)[source]¶ Return the target namespace for the given schema element.
- In order:
elements/attributes with specific target namespace
prefixed elements returns the namespace from schema ns_map
qualified elements returns the schema target namespace
unqualified elements return an empty string
unqualified attributes return None
- Parameters
obj (
ElementBase
) –- Return type
-
children_extensions
(obj, target)[source]¶ Recursively find and return all target’s Extension classes.
If the initial given obj has a type attribute include it in result.
- Parameters
obj (
ElementBase
) –target (
Class
) –
- Return type
-
build_class_attribute
(target, obj, parent_restrictions)[source]¶ Generate and append an attribute target to the target class.
- Parameters
target (
Class
) –obj (
ElementBase
) –parent_restrictions (
Restrictions
) –
-
build_class_attribute_types
(target, obj)[source]¶ Convert real type and anonymous inner types to an attribute type list.
- Parameters
target (
Class
) –obj (
ElementBase
) –
- Return type
-
build_inner_classes
(obj)[source]¶ Find and convert anonymous types to a class instances.
- Parameters
obj (
ElementBase
) –- Return type
-