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

Class 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:

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 _TypeBinding_mixin: __setattr__, toDOM, toxml, validateBinding

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __sizeof__, __str__, __subclasshook__

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

Static Methods [hide private]

Inherited from simpleTypeDefinition: __new__

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_

Properties [hide private]

Inherited from _TypeBinding_mixin (private): _validationConfig

Inherited from object: __class__

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:
Overrides: _TypeBinding_mixin.Factory

_ValidatedMember(cls, value)
Class Method

source code 

Validate the given value as a potential union member.

Raises:

__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: object.__init__
(inherited documentation)

_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