Package pyxb :: Package binding :: Module content :: Class ParticleState
[hide private]
[frames] | no frames]

Class ParticleState

source code

object --+    
         |    
   cscRoot --+
             |
            ParticleState

Instance Methods [hide private]
 
__init__(self, particle, parent_state=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
particle(self) source code
 
incrementCount(self) source code
 
verifyComplete(self) source code
 
step(self, instance, value, element_use)
Attempt to apply the value as a new instance of the particle's term.
source code
 
__str__(self)
str(x)
source code

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

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, particle, parent_state=None)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

step(self, instance, value, element_use)

source code 

Attempt to apply the value as a new instance of the particle's term.

The ContentState_mixin created for the particle's term is consulted to determine whether the instance can accept the given value. If so, the particle's maximum occurrence limit is checked; if not, and the particle has a parent state, it is informed of the failure.

Parameters:
  • instance - An instance of a subclass of {basis.complexTypeDefinition}, into which the provided value will be stored if it is consistent with the current model state.
  • value - The value that is being validated against the state.
  • element_use - An optional ElementUse instance that specifies the element to which the value corresponds. This will be available when the value is extracted by parsing a document, but will be absent if the value was passed as a constructor positional parameter.
Returns:
( consumed, underflow_exc ) A tuple where the first element is True iff the provided value was accepted in the current state. When this first element is False, the second element will be None if the particle's occurrence requirements have been met, and is an instance of MissingElementError if the observed number of terms is less than the minimum occurrence count. Depending on context, the caller may raise this exception, or may try an alternative content model.
Raises:
  • pyxb.UnexpectedElementError - if the value satisfies the particle, but having done so exceeded the allowable number of instances of the term.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)