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

Properties [hide private]

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), any constructed value is checked against constraints applied to the union as well as the member type.
Raises:
  • pyxb.BadTypeValueError - 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:

__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), the newly constructed value is checked against its constraining facets.
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