Package pyxb :: Module exceptions_ :: Class AbstractInstantiationError
[hide private]
[frames] | no frames]

Class AbstractInstantiationError

source code

              object --+                    
                       |                    
exceptions.BaseException --+                
                           |                
        exceptions.Exception --+            
                               |            
                   PyXBException --+        
                                   |        
                     ValidationError --+    
                                       |    
              ComplexTypeValidationError --+
                                           |
                                          AbstractInstantiationError

Attempt to create an instance of an abstract complex type.

These types are analogous to abstract base classes, and cannot be created directly. A type should be used that extends the abstract class.

When an incoming document is missing the xsi:type attribute which redirects an element with an abstract type to the correct type, the node attribute is provided so the user can get a clue as to where the problem occured. When this exception is a result of constructor mis-use in Python code, the traceback will tell you where the problem lies.

Instance Methods [hide private]
 
__init__(self, type, location, node)
Create an exception indicating a PyXB-related problem.
source code
 
__unicode__(self) source code
 
__str__(self)
str(x)
source code

Inherited from ValidationError: details

Inherited from PyXBException (private): _str_from_unicode

Inherited from exceptions.Exception: __new__

Inherited from exceptions.BaseException: __delattr__, __getattribute__, __getitem__, __getslice__, __reduce__, __repr__, __setattr__, __setstate__

Inherited from object: __format__, __hash__, __reduce_ex__, __sizeof__, __subclasshook__

Class Variables [hide private]
  type = None
The abstract pyxb.binding.basis.complexTypeDefinition subclass used.
  node = None
The xml.dom.Element from which instantiation was attempted, if available.

Inherited from ValidationError: location

Inherited from PyXBException (private): _args, _kw

Properties [hide private]

Inherited from exceptions.BaseException: args, message

Inherited from object: __class__

Method Details [hide private]

__init__(self, type, location, node)
(Constructor)

source code 

Create an exception indicating a PyXB-related problem.

If no args are present, a default argument is taken from the message keyword.

Parameters:
  • type - the value for the type attribute.
  • location - the value for the location attribute.
  • node - the value for the node attribute.
Overrides: object.__init__

__unicode__(self)

source code 
Overrides: exceptions.BaseException.__unicode__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)