Package pyxb :: Class ValidationConfig |
[hide private]
[frames] | no frames]

# type ValidationConfig

source code

    object --+
             |
            ValidationConfig

Class holding configuration related to validation.

pyxb.GlobalValidationConfig is available to influence validation in all contexts. Each binding class has a reference to an instance of this class, which can be inspected using pyxb.binding.basis._TypeBinding_mixin._GetValidationConfig and changed using pyxb.binding.basis._TypeBinding_mixin._SetValidationConfig. Each binding instance has a reference inherited from its class which can be inspected using pyxb.binding.basis._TypeBinding_mixin._validationConfig and changed using pyxb.binding.basis._TypeBinding_mixin._setValidationConfig.

This allows fine control on a per class and per-instance basis.

forBinding replaces RequireValidWhenParsing.

forDocument replaces RequireValidWhenGenerating.

contentInfluencesGeneration, orphanElementInContent, and invalidElementInContent control how pyxb.binding.basis.complexTypeDefinition.orderedContent affects generated documents.

Instance Methods | [hide private]
__getContentInfluencesGeneration(self) Determine whether complex type content influences element order in document generation. | source code
__getInvalidElementInContent(self) How to handle invalid elements in content lists. | source code
__getOrphanElementInContent(self) How to handle unrecognized elements in content lists. | source code
_getForBinding(self) `True` iff validation should be performed when manipulating a binding instance. | source code
_getForDocument(self) `True` iff validation should be performed when creating a document from a binding instance. | source code
_setContentInfluencesGeneration(self, value) Set the value of contentInfluencesGeneration. | source code
_setForBinding(self, value) Configure whether validation should be performed when manipulating a binding instance. | source code
_setForDocument(self, value) Configure whether validation should be performed when generating a document from a binding instance. | source code
_setInvalidElementInContent(self, value) Set the value of invalidElementInContent. | source code
_setOrphanElementInContent(self, value) Set the value of orphanElementInContent. | source code
copy(self) Make a copy of this instance. | source code

Class Variables | [hide private]
| ALWAYS = `-1`
| GIVE_UP = `2`
| IGNORE_ONCE = `1`
| MIXED_ONLY = `4`
| NEVER = `0`
| RAISE_EXCEPTION = `3`
| __contentInfluencesGeneration = `4`
| __forBinding = `True`
| __forDocument = `True`
| __invalidElementInContent = `1`
| __orphanElementInContent = `1`

Properties | [hide private]
| contentInfluencesGeneration Determine whether complex type content influences element order in document generation.
| forBinding `True` iff validation should be performed when manipulating a binding instance.
| forDocument `True` iff validation should be performed when creating a document from a binding instance.
| invalidElementInContent How to handle invalid elements in content lists.
| orphanElementInContent How to handle unrecognized elements in content lists.

Method Details | [hide private]

### __getContentInfluencesGeneration(self) | source code
Determine whether complex type content influences element order in document generation. The value is one of ALWAYS, NEVER, MIXED_ONLY (default).

### __getInvalidElementInContent(self) | source code
How to handle invalid elements in content lists. The value is one of IGNORE_ONCE (default), GIVE_UP, RAISE_EXCEPTION.

### __getOrphanElementInContent(self) | source code
How to handle unrecognized elements in content lists. This is used when consulting a complex type instance content list to influence the generation of documents from a binding instance. The value is one of IGNORE_ONCE (default), GIVE_UP, RAISE_EXCEPTION.

### _getForBinding(self) | source code
`True` iff validation should be performed when manipulating a binding instance. This includes parsing a document or DOM tree, using a binding instance class constructor, or assigning to an element or attribute field of a binding instance.

### _getForDocument(self) | source code
`True` iff validation should be performed when creating a document from a binding instance. This applies at invocation of toDOM(). toxml() invokes `toDOM()`.

### copy(self) | source code
Make a copy of this instance. Use this to get a starting point when you need to customize validation on a per-instance/per-class basis.

Property Details | [hide private]

### contentInfluencesGeneration Determine whether complex type content influences element order in document generation. The value is one of ALWAYS, NEVER, MIXED_ONLY (default). Get Method: __getContentInfluencesGeneration(self) - Determine whether complex type content influences element order in document generation.

### forBinding `True` iff validation should be performed when manipulating a binding instance. This includes parsing a document or DOM tree, using a binding instance class constructor, or assigning to an element or attribute field of a binding instance. Get Method: _getForBinding(self) - `True` iff validation should be performed when manipulating a binding instance.

### forDocument `True` iff validation should be performed when creating a document from a binding instance. This applies at invocation of toDOM(). toxml() invokes `toDOM()`. Get Method: _getForDocument(self) - `True` iff validation should be performed when creating a document from a binding instance.

### invalidElementInContent How to handle invalid elements in content lists. The value is one of IGNORE_ONCE (default), GIVE_UP, RAISE_EXCEPTION. Get Method: __getInvalidElementInContent(self) - How to handle invalid elements in content lists.

### orphanElementInContent How to handle unrecognized elements in content lists. This is used when consulting a complex type instance content list to influence the generation of documents from a binding instance. The value is one of IGNORE_ONCE (default), GIVE_UP, RAISE_EXCEPTION. Get Method: __getOrphanElementInContent(self) - How to handle unrecognized elements in content lists.