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

Class _Group

source code

    object --+        
             |        
       cscRoot --+    
                 |    
ContentModel_mixin --+
                     |
                    _Group
Known Subclasses:

Base class for content information pertaining to a model group.

There is a specific subclass for each group compositor.

Instance Methods [hide private]
 
particles(self)
The sequence of particles comprising the group
source code
 
__init__(self, *particles)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
newState(self, parent_particle_state)
Return a ContentState_mixin instance that will validate the state of this model component.
source code
 
_validate(self, symbol_set, output_sequence)
Determine whether an output sequence created from the symbols can be made consistent with the model.
source code

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

Class Variables [hide private]
  _StateClass = None
A reference to a ContentState_mixin class that maintains state when validating an instance of this group.
  __particles = None
List of ParticleModels comprising the group.
  _Group__particles = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, *particles)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

newState(self, parent_particle_state)

source code 

Return a ContentState_mixin instance that will validate the state of this model component.

Parameters:
  • parent_particle_state - The ParticleState instance for which this instance is a term. None for the top content model of a complex data type.
Overrides: ContentModel_mixin.newState
(inherited documentation)

_validate(self, symbol_set, output_sequence)

source code 

Determine whether an output sequence created from the symbols can be made consistent with the model.

The symbol set represents letters in an alphabet; the output sequence orders those letters in a way that satisfies the regular expression expressed in the model. Both are changed as a result of a successful validation; both remain unchanged if the validation failed. In recursing, implementers may assume that output_sequence is monotonic: its length remains unchanged after an invocation iff the symbol set also remains unchanged. The _validateCloneSymbolSet, _validateCloneOutputSequence, and _validateReplaceResults methods are available to help preserve this behavior.

Parameters:
  • symbol_set - A map from ElementUse instances to a list of values. The order of the values corresponds to the order in which they should appear. A key of None identifies values that are stored as wildcard elements. Values are removed from the lists as they are used; when the last value of a list is removed, its key is removed from the map. Thus an empty dictionary is the indicator that no more symbols are available.
  • output_sequence - A mutable list to which should be appended tuples ( eu, val ) where eu is an ElementUse from the set of symbol keys, and val is a value from the corresponding list. A document generated by producing the elements in the given order is expected to validate.
Returns:
True iff the model validates. symbol_set and output_path will be unchanged if this returns False.
Overrides: ContentModel_mixin._validate
(inherited documentation)