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

Class 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]
 
_getForBinding(self)
True iff validation should be performed when manipulating a binding instance.
source code
 
_setForBinding(self, value)
Configure whether 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
 
_setForDocument(self, value)
Configure whether validation should be performed when generating a document from a binding instance.
source code
 
__getContentInfluencesGeneration(self)
Determine whether complex type content influences element order in document generation.
source code
 
_setContentInfluencesGeneration(self, value)
Set the value of contentInfluencesGeneration.
source code
 
__getOrphanElementInContent(self)
How to handle unrecognized elements in content lists.
source code
 
_setOrphanElementInContent(self, value)
Set the value of orphanElementInContent.
source code
 
__getInvalidElementInContent(self)
How to handle invalid elements in content lists.
source code
 
_setInvalidElementInContent(self, value)
Set the value of invalidElementInContent.
source code
 
copy(self)
Make a copy of this instance.
source code

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

Class Variables [hide private]
  __forBinding = True
  __forDocument = True
  ALWAYS = -1
Always do it.
  NEVER = 0
Never do it.
  IGNORE_ONCE = 1
If an error occurs ignore it and continue with the next one.
  GIVE_UP = 2
If an error occurs ignore it and stop using whatever provided the cause of the error.
  RAISE_EXCEPTION = 3
If an error occurs, raise an exception.
  MIXED_ONLY = 4
Only when content type is mixed.
  __contentInfluencesGeneration = 4
  __orphanElementInContent = 1
  __invalidElementInContent = 1
Properties [hide private]
  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.
  contentInfluencesGeneration
Determine whether complex type content influences element order in document generation.
  orphanElementInContent
How to handle unrecognized elements in content lists.
  invalidElementInContent
How to handle invalid elements in content lists.

Inherited from object: __class__

Method Details [hide private]

_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().

__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).

__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.

__getInvalidElementInContent(self)

source code 

How to handle invalid elements in content lists.

The value is one of IGNORE_ONCE (default), GIVE_UP, RAISE_EXCEPTION.

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.


Class Variable Details [hide private]

IGNORE_ONCE

If an error occurs ignore it and continue with the next one. (E.g., if an element in a content list fails skip it and continue with the next element in the list.)

Value:
1

GIVE_UP

If an error occurs ignore it and stop using whatever provided the cause of the error. (E.g., if an element in a content list fails stop processing the content list and execute as though it was absent).

Value:
2

Property Details [hide private]

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.

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.

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.

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.