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

Class ElementUse

source code

                 object --+        
                          |        
utils.fac.SymbolMatch_mixin --+    
                              |    
                     _FACSymbol --+
                                  |
                                 ElementUse

Information about a schema element declaration reference.

This is used by the FAC content model to identify the location within a schema at which an element use appears. The ElementDeclaration is not sufficient since multiple uses in various schema, possibly in different namespaces, may refer to the same declaration but be independent uses.

Instance Methods [hide private]
 
elementDeclaration(self)
Return the element declaration associated with the use.
source code
 
elementBinding(self)
Return the element binding associated with the use.
source code
 
typeDefinition(self)
Return the element type.
source code
 
__init__(self, element_declaration, xsd_location)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
matchValue(self, sym)
Return the value accepted by match for this symbol.
source code
 
consumingClosure(self, sym)
Create a closure that will apply the value from sym to a to-be-supplied instance.
source code
 
match(self, symbol)
Satisfy pyxb.utils.fac.SymbolMatch_mixin.
source code
 
__str__(self)
str(x)
source code

Inherited from _FACSymbol: xsdLocation

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

Class Variables [hide private]
  __elementDeclaration = None
hash(x)

Inherited from _FACSymbol (private): _FACSymbol__xsdLocation

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

elementBinding(self)

source code 

Return the element binding associated with the use.

Equivalent to elementDeclaration().elementBinding().

typeDefinition(self)

source code 

Return the element type.

Equivalent to elementDeclaration().elementBinding().typeDefinition().

__init__(self, element_declaration, xsd_location)
(Constructor)

source code 

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

Parameters:
  • xsd_location - the location of the element use or wildcard declaration.
Overrides: object.__init__
(inherited documentation)

matchValue(self, sym)

source code 

Return the value accepted by match for this symbol.

A match for an element declaration might have resulted in a type change for the value (converting it to an acceptable type). There is no safe place to cache the compatible value calculated in the match while other candidates are being considered, so we need to re-calculate it if the transition is taken.

If the match could not have changed the value, the value from the symbol may be returned immediately.

Overrides: _FACSymbol.matchValue
(inherited documentation)

consumingClosure(self, sym)

source code 

Create a closure that will apply the value from sym to a to-be-supplied instance.

This is necessary for non-deterministic automata, where we can't store the value into the instance field until we know that the transition will be taken:

Returns:
A closure that takes a complexTypeDefinition instance and stores the value from invoking matchValue on sym into the appropriate slot.
Overrides: _FACSymbol.consumingClosure
(inherited documentation)

match(self, symbol)

source code 

Satisfy pyxb.utils.fac.SymbolMatch_mixin.

Determine whether the proposed content encapsulated in symbol is compatible with the element declaration. If so, the accepted value is cached internally and return True; otherwise return False.

Parameters:
Overrides: utils.fac.SymbolMatch_mixin.match

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)