Package pyxb :: Package xmlschema :: Module structures :: Class ComplexTypeDefinition
[hide private]
[frames] | no frames]

Class ComplexTypeDefinition

source code

                       object --+                
                                |                
                          cscRoot --+            
                                    |            
 utils.utility.PrivateTransient_mixin --+        
                                        |        
                           object --+   |        
                                    |   |        
                              cscRoot --+        
                                        |        
     namespace._ComponentDependency_mixin --+    
                                            |    
                           object --+       |    
                                    |       |    
                              cscRoot --+   |    
                                        |   |    
namespace.archive._ArchivableObject_mixin --+    
                                            |    
                           object --+       |    
                                    |       |    
                              cscRoot --+   |    
                                        |   |    
     utils.utility.PrivateTransient_mixin --+    
                                            |    
                           object --+       |    
                                    |       |    
                              cscRoot --+   |    
                                        |   |    
            utils.utility.Locatable_mixin --+    
                                            |    
                       _SchemaComponent_mixin --+
                                                |
                           object --+           |
                                    |           |
                              cscRoot --+       |
                                        |       |
     utils.utility.PrivateTransient_mixin --+   |
                                            |   |
                               object --+   |   |
                                        |   |   |
                                  cscRoot --+   |
                                            |   |
                        _NamedComponent_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
       namespace.resolution._Resolvable_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                             _Annotated_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                     _AttributeWildcard_mixin --+
                                                |
                                               ComplexTypeDefinition
Known Subclasses:

Instance Methods [hide private]
 
baseTypeDefinition(self)
The type resolved from the base attribute.
source code
 
derivationMethod(self)
How the type was derived.
source code
 
abstract(self) source code
 
attributeUses(self)
A frozenset() of AttributeUse instances.
source code
 
lookupScopedAttributeDeclaration(self, expanded_name)
Find an attribute declaration with the given name that is local to this type.
source code
 
lookupScopedElementDeclaration(self, expanded_name)
Find an element declaration with the given name that is local to this type.
source code
 
localScopedDeclarations(self, reset=False)
Return a list of element and attribute declarations that were introduced in this definition (i.e., their scope is this CTD).
source code
 
_recordLocalDeclaration(self, decl)
Record the given declaration as being locally scoped in this type.
source code
 
_isHierarchyRoot(self)
Return True iff this is the root of a complex type definition hierarchy.
source code
 
_contentTypeTag(self)
Return the value of the content type identifier, i.e.
source code
 
_contentTypeComponent(self) source code
 
contentType(self)
Identify the sort of content in this type.
source code
 
contentTypeAsString(self) source code
 
__init__(self, *args, **kw)
Initialize portions of a component.
source code
 
hasWildcardElement(self)
Return True iff this type includes a wildcard element in its content model.
source code
 
_updateFromOther_csc(self, other)
Override fields in this instance with those from the other.
source code
 
isBuiltin(self)
Indicate whether this simple type is a built-in type.
source code
frozenset
_bindingRequires_vx(self, include_lax)
Complex type definitions depend on their base type definition, the type definitions of any local attribute declarations, and if strict the type definitions of any local element declarations.
source code
 
__completeProcessing(self, method, content_style) source code
 
__simpleContent(self, method, **kw) source code
 
_isComplexContent(self) source code
 
__setComplexContentFromDOM(self, type_node, content_node, definition_node_list, method, **kw) source code
 
__complexContent(self, method) source code
 
isResolved(self)
Indicate whether this complex type is fully defined.
source code
 
_setDerivationMethod(self, derivation_method) source code
 
__setContentFromDOM(self, node, **kw) source code
 
_resolve(self)
Perform whatever steps are required to resolve this component.
source code
 
pythonSupport(self)
Complex type definitions have no built-in type support.
source code
 
__str__(self)
str(x)
source code

Inherited from _SchemaComponent_mixin: bestNCName, facStateSortKey, hasBinding, isTypeDefinition, isUrTypeDefinition, nameInBinding, owner, schemaOrderSortKey, setNameInBinding

Inherited from namespace._ComponentDependency_mixin: bindingRequires

Inherited from _NamedComponent_mixin: __getnewargs__, __getstate__, __setstate__, bindingNamespace, expandedName, isAnonymous, isDerivationConsistent, isNameEquivalent, isTypeEquivalent, name, targetNamespace

Inherited from _Annotated_mixin: annotation

Inherited from _Annotated_mixin (private): _annotationFromDOM

Inherited from _AttributeWildcard_mixin: attributeWildcard

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

Class Methods [hide private]
 
UrTypeDefinition(cls, schema=None, in_builtin_definition=False)
Create the ComplexTypeDefinition instance that approximates the ur-type.
source code
 
CreateFromDOM(cls, node, **kw) source code

Inherited from _AttributeWildcard_mixin: CompleteWildcard

Static Methods [hide private]

Inherited from _NamedComponent_mixin: __new__

Class Variables [hide private]
  __PrivateTransient = set(['anyAttribute', 'attributeGroupAttri...
  __baseTypeDefinition = None
hash(x)
  DM_empty = 0
  DM_extension = 1
  DM_restriction = 2
  _DM_Map = {'extension': 1, 'restriction': 2}
  __derivationMethod = None
hash(x)
  __final = 0
  __abstract = False
  __attributeUses = None
hash(x)
  __scopedAttributeDeclarations = None
hash(x)
  __scopedElementDeclarations = None
hash(x)
  __localScopedDeclarations = None
hash(x)
  CT_EMPTY = 'EMPTY'
  CT_SIMPLE = 'SIMPLE'
  CT_MIXED = 'MIXED'
hash(x)
  CT_ELEMENT_ONLY = 'ELEMENT_ONLY'
  __contentType = None
hash(x)
  __prohibitedSubstitutions = 0
  __annotations = None
hash(x)
  __UrTypeDefinition = None
  __baseAttribute = None
hash(x)
  __ckw = None
hash(x)
  __anyAttribute = None
hash(x)
  __attributeGroupAttributes = None
hash(x)
  __usesC1 = None
hash(x)
  __usesC1C2 = None
hash(x)
  __attributeGroups = None
hash(x)
  __ctscClause2STD = None
hash(x)
  __ctscRestrictionNode = None
hash(x)
  __effectiveMixed = None
hash(x)
  __effectiveContent = None
hash(x)
  __pendingDerivationMethod = None
hash(x)
  __isComplexContent = None
hash(x)
  __ctscRestrictionMode = None
hash(x)
  __contentStyle = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

lookupScopedAttributeDeclaration(self, expanded_name)

source code 

Find an attribute declaration with the given name that is local to this type.

Returns None if there is no such local attribute declaration.

lookupScopedElementDeclaration(self, expanded_name)

source code 

Find an element declaration with the given name that is local to this type.

Returns None if there is no such local element declaration.

localScopedDeclarations(self, reset=False)

source code 

Return a list of element and attribute declarations that were introduced in this definition (i.e., their scope is this CTD).

Parameters:
  • reset - If False (default), a cached previous value (if it exists) will be returned.

Note: This specifically returns a list, with element declarations first, because name binding should privilege the elements over the attributes. Within elements and attributes, the components are sorted by expanded name, to ensure consistency across a series of binding generations.

_contentTypeTag(self)

source code 

Return the value of the content type identifier, i.e. one of the CT_ constants. Return value is None if no content type has been defined.

contentType(self)

source code 

Identify the sort of content in this type.

Valid values are:

__init__(self, *args, **kw)
(Constructor)

source code 

Initialize portions of a component.

Parameters:
  • scope - The scope in which the component is defined
  • namespace_context - The NamespaceContext to use within this component
  • node - If no namespace_context is provided, a DOM node must be provided from which a namespace context can be identified.
  • owner - Reference to the component that owns this one (the immediately enclosing component). Is None in the case of top-level components.
  • schema - Reference to the Schema component to which the component belongs. Required for every component except Schema, Annotation, and Wildcard.
Overrides: object.__init__
(inherited documentation)

_updateFromOther_csc(self, other)

source code 

Override fields in this instance with those from the other.

This method is invoked only by Schema._addNamedComponent, and then only when a built-in type collides with a schema-defined type. Material like facets is not (currently) held in the built-in copy, so the DOM information is copied over to the built-in STD, which is subsequently re-resolved.

Returns self.

Overrides: _Annotated_mixin._updateFromOther_csc

UrTypeDefinition(cls, schema=None, in_builtin_definition=False)
Class Method

source code 

Create the ComplexTypeDefinition instance that approximates the ur-type.

See section 3.4.7.

_bindingRequires_vx(self, include_lax)

source code 

Complex type definitions depend on their base type definition, the type definitions of any local attribute declarations, and if strict the type definitions of any local element declarations.

Returns: frozenset
The component instances on which this component depends
Raises:
  • LogicError - A subclass failed to implement this method
Overrides: namespace._ComponentDependency_mixin._bindingRequires_vx

isResolved(self)

source code 

Indicate whether this complex type is fully defined.

All built-in type definitions are resolved upon creation. Schema-defined type definitionss are held unresolved until the schema has been completely read, so that references to later schema-defined types can be resolved. Resolution is performed after the entire schema has been scanned and type-definition instances created for all topLevel{Simple,Complex}Types.

If a built-in type definition is also defined in a schema (which it should be), the built-in definition is kept, with the schema-related information copied over from the matching schema-defined type definition. The former then replaces the latter in the list of type definitions to be resolved. See Schema._addNamedComponent.

Overrides: namespace.resolution._Resolvable_mixin.isResolved

_resolve(self)

source code 

Perform whatever steps are required to resolve this component.

Resolution is performed in the context of the namespace to which the component belongs. Invoking this method may fail to complete the resolution process if the component itself depends on unresolved components. The sole caller of this should be _NamespaceResolution_mixin.resolveDefinitions.

This method is permitted (nay, encouraged) to raise an exception if resolution requires interpreting a QName and the named component cannot be found.

Override this in the child class. In the prefix, if isResolved is true, return right away. If something prevents you from completing resolution, invoke self._queueForResolution() (so it is retried later) and immediately return self. Prior to leaving after successful resolution discard any cached dom node by setting self.__domNode=None.

Returns:
self, whether or not resolution succeeds.
Raises:
Overrides: namespace.resolution._Resolvable_mixin._resolve
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

Class Variable Details [hide private]

__PrivateTransient

Value:
set(['anyAttribute',
     'attributeGroupAttributes',
     'attributeGroups',
     'ckw',
     'usesC1',
     'usesC1C2'])