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

Class ContentModelState

source code

object --+    
         |    
   cscRoot --+
             |
            ContentModelState

Represents a state in a ContentModel DFA.

The state identifier is an integer. State 1 is the starting state of the DFA. A flag indicates whether the state is a legitimate final state for the DFA. The transitions are an ordered sequence of ContentModelTransition instances.

Instance Methods [hide private]
 
isFinal(self)
If True, this state can successfully complete the element reduction.
source code
 
state(self) source code
 
__init__(self, state, is_final, transitions)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
transitions(self) source code
 
allowsEpsilonTransitionToFinal(self, content_model)
Determine can reach a final state in the content model without consuming anything.
source code
 
evaluateContent(self, ctd_instance, value, element_use, dfa_stack)
Try to make a single transition with the given value.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Class Variables [hide private]
  __state = None
  __transitions = None
  __elementTermMap = None
  __isFinal = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, state, is_final, transitions)
(Constructor)

source code 

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

Overrides: object.__init__
(inherited documentation)

evaluateContent(self, ctd_instance, value, element_use, dfa_stack)

source code 

Try to make a single transition with the given value.

Parameters:
  • ctd_instance (basis.complexTypeDefinition) - The binding instance for which we are attempting to set values by walking the content model.
  • value (xml.dom.Node or basis._TypeBinding_mixin) - The value that would be consumed if a transition can be made.
  • element_use - The ElementUse corresponding to the provided value, if known (for example, because the value was parsed from an XML document).
  • dfa_stack (DFAStack) - The current state of processing this and enclosing content models.
Returns:
If a transition could be taken, the next state in the content model. None if no transition could be taken and this state is final.
Raises: