XmlVar#
- class xsdata.formats.dataclass.models.elements.XmlVar(index, name, qname, types, clazz, init, mixed, factory, tokens_factory, format, derived, any_type, required, nillable, sequential, default, xml_type, namespaces, elements, wildcards, **kwargs)[source]#
Class field binding metadata.
- Parameters:
index (
int
) – Field orderingname (
str
) – Field nameqname (
str
) – Qualified nametypes (
Sequence
[Type
]) – List of all the supported data typesinit (
bool
) – Include field in the constructormixed (
bool
) – Field supports mixed content type valuestokens – Field is derived from xs:list
derived (
bool
) – Wrap parsed values with a generic typeany_type (
bool
) – Field supports dynamic value typesrequired (
bool
) – Field is mandatorynillable (
bool
) – Field supports nillable contentsequential (
bool
) – Render values in sequential modelist_element – Field is a list of elements
default (
Any
) – Field default value or factoryxml_Type – Field xml type
namespaces (
Sequence
[str
]) – List of the supported namespaceselements (
Mapping
[str
,XmlVar
]) – Mapping of qname-repeatable elements
- find_value_choice(value, is_class)[source]#
Match and return a choice field that matches the given value.
- Cases:
value is none or empty tokens list: look for a nillable choice
value is a dataclass: look for exact type or a subclass
value is primitive: test value against the converter
- is_optional(value)[source]#
Return whether this var instance is not required and the given value matches the default one.
- Return type:
- match_namespace(qname)[source]#
Match the given qname to the wildcard allowed namespaces.
- Return type:
- __hash__ = None#