Package pyxb :: Package binding :: Module basis :: Class simpleTypeDefinition |
[hide private]
[frames] | no frames]

# type simpleTypeDefinition

source code

                        object --+
                                 |
                           cscRoot --+
                                     |
         utils.utility.Locatable_mixin --+
                                         |
                        _TypeBinding_mixin --+
                                             |
                                object --+   |
                                         |   |
    utils.utility._DeconflictSymbols_mixin --+
                                             |
                            object --+       |
                                     |       |
                               cscRoot --+   |
                                         |   |
                      _DynamicCreate_mixin --+
                                             |
                                            simpleTypeDefinition

Known Subclasses:
  - STD_list
  - , STD_union
  - , datatypes.string
  - , datatypes.anySimpleType
  - , datatypes.integer
  - , datatypes.decimal
  - , datatypes.boolean
  - , datatypes.NOTATION
  - , datatypes.QName
  - , datatypes._PyXBDateTime_base
  - , datatypes.anyURI
  - , datatypes.base64Binary
  - , datatypes.int
  - , datatypes.double
  - , datatypes.duration
  - , datatypes.float
  - , datatypes.hexBinary

simpleTypeDefinition is a base class that is part of the hierarchy of any class that represents the Python datatype for a SimpleTypeDefinition.

Note: This class, or a descendent of it, must be the first class in the method resolution order when a subclass has multiple parents. Otherwise, constructor keyword arguments may not be removed before passing them on to Python classes that do not accept them.

Instance Methods | [hide private]
__init__(self, *args, **kw) Initialize a newly created STD instance. | source code
xsdLiteral(self) Return text suitable for representing the value of this instance in an XML document. | source code
xsdConstraintsOK(self, location=None) Validate the value of this instance against its constraints. | source code
_validateBinding_vx(self) Override in subclasses for type-specific validation of instance content. | source code
xsdValueLength(self) Return the length of this instance within its value space. | source code
pythonLiteral(self) Return a string which can be embedded into Python source to represent the value of this instance. | source code
_toDOM_csc(self, dom_support, parent) | source code
_checkValidValue(self) | source code
_isValidValue(self) | source code
_setAttribute(self, attr_en, value_lex) | source code
Inherited from `_TypeBinding_mixin`: `__setattr__`, `toDOM`, `toxml`, `validateBinding` Inherited from `_TypeBinding_mixin` (private): `_TypeBinding_mixin__checkNilCtor`, `_TypeBinding_mixin__getValidationConfig`, `_constructedWithValue`, `_diagnosticName`, `_element`, `_finalizeContentModel`, `_isNil`, `_namespaceContext`, `_performValidation`, `_postDOMValidate`, `_postFactory_vx`, `_resetContent`, `_setAttributesFromKeywordsAndDOM`, `_setElement`, `_setIsNil`, `_setNamespaceContext`, `_setValidationConfig`, `_substitutesFor` Inherited from `utils.utility.Locatable_mixin` (private): `_location`, `_setLocation`

Class Methods | [hide private]
__FacetMapAttributeName(cls) | source code
_FacetMap(cls) Return a reference to the facet map for this datatype. | source code
_InitializeFacetMap(cls, *args) Initialize the facet map for this datatype. | source code
_ConvertArguments_vx(cls, args, kw) | source code
_ConvertArguments(cls, args, kw) Pre-process the arguments. | source code
__STDAttrName(cls) | source code
_SimpleTypeDefinition(cls, std) Set the pyxb.xmlschema.structures.SimpleTypeDefinition instance associated with this binding. | source code
SimpleTypeDefinition(cls) Return the SimpleTypeDefinition instance for the given class. | source code
XsdLiteral(cls, value) Convert from a python value to a string usable in an XML document. | source code
XsdSuperType(cls) Find the nearest parent class in the PST hierarchy. | source code
_XsdConstraintsPreCheck_vb(cls, value) Pre-extended class method to verify other things before checking constraints. | source code
XsdConstraintsOK(cls, value, location=None) Validate the given value against the constraints on this class. | source code
XsdValueLength(cls, value) Return the length of the given value. | source code
PythonLiteral(cls, value) Return a string which can be embedded into Python source to represent the given value as an instance of this class. | source code
_IsSimpleTypeContent(cls) STDs have simple type content. | source code
_IsValidValue(self, value) | source code
_CheckValidValue(cls, value) NB: Invoking this on a value that is a list will, if necessary, replace the members of the list with new values that are of the correct item type. | source code
_description(cls, name_only=False, user_documentation=True) | source code
Inherited from `_TypeBinding_mixin`: `Factory` Inherited from `_TypeBinding_mixin` (private): `_CompatibleValue`, `_GetValidationConfig`, `_IsUrType`, `_Name`, `_PerformValidation`, `_PreFactory_vx`, `_RequireXSIType`, `_SetValidationConfig`, `_TypeBinding_mixin__AttributesFromDOM` Inherited from `_DynamicCreate_mixin` (private): `_AlternativeConstructor`, `_DynamicCreate`, `_DynamicCreate_mixin__AlternativeConstructorAttribute`, `_DynamicCreate_mixin__SupersedingClassAttribute`, `_SetAlternativeConstructor`, `_SetSupersedingClass`, `_SupersedingClass`

Static Methods | [hide private]
__new__(cls, *args, **kw) | source code

Class Variables | [hide private]
| __FacetMap = ``{``}``
| _ReservedSymbols = ``set([``'``Factory``'``,` `'``PythonLiteral``'``,` `'``SimpleTyp``...`` Symbols that remain the responsibility of this class.
| __FacetMapAttributeNameMap = ``{`<class 'pyxb.binding.basis.STD_l`...``
| __ClassFacetSequence = ``{``}``
Inherited from `_TypeBinding_mixin`: `_validationConfig_` Inherited from `_TypeBinding_mixin` (private): `_Abstract`, `_AttributeMap`, `_AttributeWildcard`, `_ExpandedName`, `_PyXBFactoryKeywords`, `_TypeBinding_mixin__WarnedUnassociatedElement`, `_TypeBinding_mixin__constructedWithValue`, `_TypeBinding_mixin__element`, `_TypeBinding_mixin__namespaceContext`, `_TypeBinding_mixin__xsiNil`, `_XSDLocation`

Properties | [hide private]
Inherited from `_TypeBinding_mixin` (private): `_validationConfig`

Method Details | [hide private]

### _FacetMap(cls) Class Method | source code
Return a reference to the facet map for this datatype. The facet map is a map from leaf facet classes to instances of those classes that constrain or otherwise apply to the lexical or value space of the datatype. Classes may inherit their facet map from their superclass, or may create a new class instance if the class adds a new constraint type. Raises: `AttributeError` - if the facet map has not been defined

### _InitializeFacetMap(cls, *args) Class Method | source code
Initialize the facet map for this datatype. This must be called exactly once, after all facets belonging to the datatype have been created. Raises: `pyxb.LogicError` - if called multiple times (on the same class) `pyxb.LogicError` - if called when a parent class facet map has not been initialized :return: the facet map

### _ConvertArguments(cls, args, kw) Class Method | source code
Pre-process the arguments. This is used before invoking the parent constructor. One application is to apply the whitespace facet processing; if such a request is in the keywords, it is removed so it does not propagate to the superclass. Another application is to convert the arguments from a string to a list. Binding-specific applications are performed in the overloaded _ConvertArguments_vx method.

### __new__(cls, *args, **kw) Static Method | source code
Overrides: object.__new__ (inherited documentation)

### __init__(self, *args, **kw) (Constructor) | source code
Initialize a newly created STD instance. Usually there is one positional argument, which is a value that can be converted to the underlying Python type. Parameters: `_validate_constraints` (`bool`) - If True (default if validation is enabled), the newly constructed value is checked against its constraining facets. `_apply_attributes` - If `True` (default), any attributes present in the keywords or DOM node are applied. Normally presence of such an attribute should produce an error; when creating simple content for a complex type we need the DOM node, but do not want to apply the attributes, so we bypass the application. Overrides: cscRoot.__init__

### SimpleTypeDefinition(cls) Class Method | source code
Return the SimpleTypeDefinition instance for the given class. This should only be invoked when generating bindings. An STD must have been associated with the class using _SimpleTypeDefinition.

### XsdLiteral(cls, value) Class Method | source code
Convert from a python value to a string usable in an XML document. This should be implemented in the subclass.

### xsdLiteral(self) | source code
Return text suitable for representing the value of this instance in an XML document. The base class implementation delegates to the object class's XsdLiteral method.

### XsdSuperType(cls) Class Method | source code
Find the nearest parent class in the PST hierarchy. The value for anySimpleType is None; for all others, it's a primitive or derived PST descendent (including anySimpleType).

### _XsdConstraintsPreCheck_vb(cls, value) Class Method | source code
Pre-extended class method to verify other things before checking constraints. This is used for list types, to verify that the values in the list are acceptable, and for token descendents, to check the lexical/value space conformance of the input.

### XsdConstraintsOK(cls, value, location=None) Class Method | source code
Validate the given value against the constraints on this class. Raises: `pyxb.SimpleTypeValueError` - if any constraint is violated.

### _validateBinding_vx(self) | source code
Override in subclasses for type-specific validation of instance content. Returns: `True` if the instance validates Raises: `pyxb.BatchContentValidationError` - complex content does not match model `pyxb.SimpleTypeValueError` - simple content fails to satisfy constraints Overrides: _TypeBinding_mixin._validateBinding_vx (inherited documentation)

### XsdValueLength(cls, value) Class Method | source code
Return the length of the given value. The length is calculated by a subclass implementation of _XsdValueLength_vx in accordance with http://www.w3.org/TR/xmlschema-2/#rf-length. The return value is a non-negative integer, or `None` if length constraints should be considered trivially satisfied (as with QName and NOTATION). Raises: `pyxb.LogicError` - the provided value is not an instance of cls. `pyxb.LogicError` - an attempt is made to calculate a length for an instance of a type that does not support length calculations.

### xsdValueLength(self) | source code
Return the length of this instance within its value space. See XsdValueLength.

### _toDOM_csc(self, dom_support, parent) | source code
Overrides: _TypeBinding_mixin._toDOM_csc

### _IsSimpleTypeContent(cls) Class Method | source code
STDs have simple type content. Overrides: _TypeBinding_mixin._IsSimpleTypeContent

### _CheckValidValue(cls, value) Class Method | source code
NB: Invoking this on a value that is a list will, if necessary, replace the members of the list with new values that are of the correct item type. This is permitted because only with lists is it possible to bypass the normal content validation (by invoking append/extend on the list instance).

Class Variable Details | [hide private]

  ### _ReservedSymbols Symbols that remain the responsibility of this class. Any public symbols in generated binding subclasses are deconflicted by providing an alternative name in the subclass. (There currently are no public symbols in generated SimpleTypeDefinion bindings. Value:
      set(['Factory',
           'PythonLiteral',
           'SimpleTypeDefinition',
           'XsdConstraintsOK',
           'XsdLiteral',
           'XsdPythonType',
           'XsdSuperType',
           'XsdValueLength',
      ...

  ### __FacetMapAttributeNameMap Value:
      {<class 'pyxb.binding.basis.STD_list'>: u'_STD_list_FacetMap',
       <class 'pyxb.binding.datatypes.boolean'>: u'_httpwww_w3_org2001XMLSch
      ema_boolean_FacetMap',
       <class 'pyxb.binding.xml_.STD_ANON_space'>: u'_STD_ANON_space_FacetMa
      p',
       <class 'pyxb.binding.xml_.STD_ANON_emptyString'>: u'_STD_ANON_emptySt
      ring_FacetMap',
       <class 'pyxb.binding.xml_.STD_ANON_lang'>: u'_STD_ANON_lang_FacetMap'
      ...