Package pyxb :: Package binding :: Module basis :: Class STD_union |
[hide private]
[frames] | no frames]

# type STD_union

source code

                        object --+
                                 |
                           cscRoot --+
                                     |
         utils.utility.Locatable_mixin --+
                                         |
                        _TypeBinding_mixin --+
                                             |
                                object --+   |
                                         |   |
    utils.utility._DeconflictSymbols_mixin --+
                                             |
                            object --+       |
                                     |       |
                               cscRoot --+   |
                                         |   |
                      _DynamicCreate_mixin --+
                                             |
                          simpleTypeDefinition --+
                                                 |
                                                STD_union

Known Subclasses:
  - xml_.STD_ANON_lang

Base class for union datatypes.

This class descends only from simpleTypeDefinition. A pyxb.LogicError is raised if an attempt is made to construct an instance of a subclass of STD_union. Values consistent with the member types are constructed using the Factory class method. Values are validated using the _ValidatedMember class method.

Subclasses must provide a class variable _MemberTypes which is a tuple of legal members of the union.

Instance Methods | [hide private]
__init__(self, *args, **kw) Initialize a newly created STD instance. | source code
Inherited from `simpleTypeDefinition`: `pythonLiteral`, `xsdConstraintsOK`, `xsdLiteral`, `xsdValueLength` Inherited from `simpleTypeDefinition` (private): `_checkValidValue`, `_isValidValue`, `_setAttribute`, `_toDOM_csc`, `_validateBinding_vx` Inherited from `_TypeBinding_mixin`: `__setattr__`, `toDOM`, `toxml`, `validateBinding` Inherited from `_TypeBinding_mixin` (private): `_TypeBinding_mixin__checkNilCtor`, `_TypeBinding_mixin__getValidationConfig`, `_constructedWithValue`, `_diagnosticName`, `_element`, `_finalizeContentModel`, `_isNil`, `_namespaceContext`, `_performValidation`, `_postDOMValidate`, `_postFactory_vx`, `_resetContent`, `_setAttributesFromKeywordsAndDOM`, `_setElement`, `_setIsNil`, `_setNamespaceContext`, `_setValidationConfig`, `_substitutesFor` Inherited from `utils.utility.Locatable_mixin` (private): `_location`, `_setLocation`

Class Methods | [hide private]
Factory(cls, *args, **kw) Given a value, attempt to create an instance of some member of this union. | source code
_ValidatedMember(cls, value) Validate the given value as a potential union member. | source code
_description(cls, name_only=False, user_documentation=True) | source code
XsdLiteral(cls, value) Convert from a binding value to a string usable in an XML document. | source code
Inherited from `simpleTypeDefinition`: `PythonLiteral`, `SimpleTypeDefinition`, `XsdConstraintsOK`, `XsdSuperType`, `XsdValueLength` Inherited from `simpleTypeDefinition` (private): `_CheckValidValue`, `_ConvertArguments`, `_ConvertArguments_vx`, `_FacetMap`, `_InitializeFacetMap`, `_IsSimpleTypeContent`, `_IsValidValue`, `_SimpleTypeDefinition`, `_XsdConstraintsPreCheck_vb` Inherited from `_TypeBinding_mixin` (private): `_CompatibleValue`, `_GetValidationConfig`, `_IsUrType`, `_Name`, `_PerformValidation`, `_PreFactory_vx`, `_RequireXSIType`, `_SetValidationConfig`, `_TypeBinding_mixin__AttributesFromDOM` Inherited from `_DynamicCreate_mixin` (private): `_AlternativeConstructor`, `_DynamicCreate`, `_DynamicCreate_mixin__AlternativeConstructorAttribute`, `_DynamicCreate_mixin__SupersedingClassAttribute`, `_SetAlternativeConstructor`, `_SetSupersedingClass`, `_SupersedingClass`

Static Methods | [hide private]
__new__(self, *args, **kw) | source code

Class Variables | [hide private]
| _MemberTypes = `None` A list of classes which are permitted as values of the union.
| __FacetMap = ``{``}``
Inherited from `simpleTypeDefinition` (private): `_ReservedSymbols` Inherited from `_TypeBinding_mixin`: `_validationConfig_` Inherited from `_TypeBinding_mixin` (private): `_Abstract`, `_AttributeMap`, `_AttributeWildcard`, `_ExpandedName`, `_PyXBFactoryKeywords`, `_TypeBinding_mixin__WarnedUnassociatedElement`, `_TypeBinding_mixin__constructedWithValue`, `_TypeBinding_mixin__element`, `_TypeBinding_mixin__namespaceContext`, `_TypeBinding_mixin__xsiNil`, `_XSDLocation`

Properties | [hide private]
Inherited from `_TypeBinding_mixin` (private): `_validationConfig`

Method Details | [hide private]

### Factory(cls, *args, **kw) Class Method | source code
Given a value, attempt to create an instance of some member of this union. The first instance which can be legally created is returned. Parameters: `_validate_constraints` - If `True` (default if validation is enabled), any constructed value is checked against constraints applied to the union as well as the member type. Raises: `pyxb.SimpleTypeValueError` - no member type will permit creation of an instance from the parameters in `args` and `kw`. Overrides: _TypeBinding_mixin.Factory

### _ValidatedMember(cls, value) Class Method | source code
Validate the given value as a potential union member. Raises: `pyxb.SimpleTypeValueError` - the value is not an instance of a member type.

### __new__(self, *args, **kw) Static Method | source code
Overrides: simpleTypeDefinition.__new__

### __init__(self, *args, **kw) (Constructor) | source code
Initialize a newly created STD instance. Usually there is one positional argument, which is a value that can be converted to the underlying Python type. Parameters: `_validate_constraints` - If True (default if validation is enabled), the newly constructed value is checked against its constraining facets. `_apply_attributes` - If `True` (default), any attributes present in the keywords or DOM node are applied. Normally presence of such an attribute should produce an error; when creating simple content for a complex type we need the DOM node, but do not want to apply the attributes, so we bypass the application. Overrides: cscRoot.__init__

### _description(cls, name_only=False, user_documentation=True) Class Method | source code
Overrides: simpleTypeDefinition._description

### XsdLiteral(cls, value) Class Method | source code
Convert from a binding value to a string usable in an XML document. Overrides: simpleTypeDefinition.XsdLiteral