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 help(type(x)) for signature
source code
 
particle(self)
The ParticleModel for which this represents state.
source code
 
incrementCount(self)
Reset for a new occurrence of the particle's term.
source code
 
verifyComplete(self)
Check whether the particle's occurrence constraints are satisfied.
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__

Class Variables [hide private]
  __parentState = None
The ContentState_mixin which contains the mode for which this is state.
  __termState = None
A ContentState_mixin instance for one occurrence of this particle's term.
  __tryAccept = None
A flag indicating whether a proposed value should be applied to the state by step.
  __particle = None
The ParticleModel for which this represents state.
  __count = None
The number of times this particle's term has been matched.
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 help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

verifyComplete(self)

source code 

Check whether the particle's occurrence constraints are satisfied.

Raises:

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)