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

Class ContentModelTransition

source code

object --+    
         |    
   cscRoot --+
             |
            ContentModelTransition

Represents a transition in the content model DFA.

If the next object in the DOM model conforms to the specified term, it is consumed and the specified next state is entered.

Instance Methods [hide private]
 
term(self)
The matching term for this transition to succeed.
source code
 
currentStateRef(self) source code
 
_currentStateRef(self, current_state_ref) source code
 
nextState(self)
The next state in the DFA
source code
 
elementUse(self) source code
 
termType(self) source code
 
__init__(self, next_state, element_use=None, term=None)
Create a transition to a new state upon receipt of a term, storing the successful match using the provided ElementUse.
source code
 
__cmp__(self, other)
Sort transitions so elements precede model groups precede wildcards.
source code
 
__processElementTransition(self, value, element_use) source code
 
__validateConsume(self, key, available_symbols_im, output_sequence_im, candidates) source code
 
validate(self, available_symbols_im, output_sequence_im, candidates)
Determine whether it is possible to take this transition using the available symbols.
source code
 
allowsEpsilonTransition(self)
Determine whether it is possible to take this transition without consuming any symbols.
source code
 
attemptTransition(self, ctd_instance, value, element_use, dfa_stack)
Attempt to make the appropriate transition.
source code

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

Class Variables [hide private]
  __term = None
  __currentStateRef = None
  __nextState = None
  __elementUse = None
  TT_element = 1
  TT_modelGroupAll = 2
  TT_wildcard = 3
  __termType = None
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, next_state, element_use=None, term=None)
(Constructor)

source code 

Create a transition to a new state upon receipt of a term, storing the successful match using the provided ElementUse.

Overrides: object.__init__

__cmp__(self, other)
(Comparison operator)

source code 

Sort transitions so elements precede model groups precede wildcards. Also sort within each subsequence.

validate(self, available_symbols_im, output_sequence_im, candidates)

source code 

Determine whether it is possible to take this transition using the available symbols.

Parameters:
  • available_symbols_im - As with ContentModel.validate. The map will not be modified by this method.
  • output_sequence_im - As with the return value of ContentModel.validate. The sequence will not be modified by this event (it is used as a prefix for new candidates).
  • candidates - A list of candidate validation paths.
Returns:
True iff the transition could be made.

allowsEpsilonTransition(self)

source code 

Determine whether it is possible to take this transition without consuming any symbols.

This is only possible if this is a transition to a final state using an "all" model group for which every alternative is effectively optional.

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

source code 

Attempt to make the appropriate transition.

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 potential value that would be consumed if this transition can be made.
  • dfa_stack (DFAStack) - The current state of processing this and enclosing content models.
Returns:
True iff value is acceptable for this transition