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

# type 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) | 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) | source code
Inherited from `_FACSymbol`: `xsdLocation`

Class Variables | [hide private]
| __elementDeclaration = `None`
Inherited from `_FACSymbol` (private): `_FACSymbol__xsdLocation`

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
Parameters: `xsd_location` - the location of the element use or wildcard declaration. Overrides: _FACSymbol.__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: `symbol` - a pair `(value, element_decl)`. pyxb.binding.content.ElementDeclaration._matches is used to determine whether the proposed content is compatible with this element declaration. Overrides: utils.fac.SymbolMatch_mixin.match

### __str__(self) (Informal representation operator) | source code
Overrides: object.__str__ (inherited documentation)