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

Class _SchemaComponent_mixin

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
Known Subclasses:

A mix-in that marks the class as representing a schema component.

This exists so that we can determine the owning schema for any component we encounter. This is normally done at construction time by passing a schema=val parameter to the constructor.

Instance Methods [hide private]
 
_namespaceContext(self)
The namespace context for this schema.
source code
 
_clearNamespaceContext(self) source code
 
_scope(self)
The context into which declarations in or subordinate to this nodeare placed.
source code
 
_scopeIsIndeterminate(self)
Return True iff nobody has defined a scope for this node.
source code
 
_scopeIsGlobal(self)
Return True iff this component has global scope.
source code
 
_setScope(self, ctd)
Set the scope of this instance after construction.
source code
 
__init__(self, *args, **kw)
Initialize portions of a component.
source code
 
_dissociateFromNamespace(self)
Dissociate this component from its owning namespace.
source code
 
_setOwner(self, owner)
Set the owner of this component.
source code
 
owner(self) source code
 
_cloneSource(self)
The source component from which this is a clone.
source code
 
_clones(self)
The set of instances cloned from this component.
source code
None
_resetClone_csc(self, **kw)
Virtual method to clear whatever attributes should be reset in a cloned component.
source code
 
_clone(self, owner, origin)
Create a copy of this instance suitable for adoption by some other component.
source code
 
isTypeDefinition(self)
Return True iff this component is a simple or complex type definition.
source code
 
isUrTypeDefinition(self)
Return True iff this component is a simple or complex type definition.
source code
 
bestNCName(self)
Return the name of this component, as best it can be determined.
source code
 
nameInBinding(self)
Return the name by which this component is known in the generated binding.
source code
 
hasBinding(self)
Return True iff this is a component which has a user-visible Python construct which serves as its binding.
source code
 
setNameInBinding(self, name_in_binding)
Set the name by which this component shall be known in the XSD binding.
source code
 
_updateFromOther_csc(self, other)
Override fields in this instance with those from the other.
source code
 
schemaOrderSortKey(self)
A key to be used when sorting components for binding generation.
source code
 
facStateSortKey(self)
A sort key matching preferred content order.
source code
 
_setFacStateSortKey(self, key)
Set the automata state sort key.
source code

Inherited from namespace._ComponentDependency_mixin: bindingRequires

Inherited from utils.utility.PrivateTransient_mixin: __getstate__

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

Class Variables [hide private]
  __PrivateTransient = set()
  __namespaceContext = None
hash(x)
  __nameInBinding = None
hash(x)
  __owner = None
hash(x)
  __ownedComponents = None
hash(x)
  __scope = None
hash(x)
  __cloneSource = None
hash(x)
  __clones = None
hash(x)
  __schemaOrderSortKey = None
hash(x)
  __facStateSortKey = None
hash(x)
  _SchemaComponent_mixin__PrivateTransient = set(['cloneSource',...
  _SchemaComponent_mixin__cloneSource = None
hash(x)
  _SchemaComponent_mixin__clones = None
hash(x)
  _SchemaComponent_mixin__facStateSortKey = None
hash(x)
  _SchemaComponent_mixin__nameInBinding = None
hash(x)
  _SchemaComponent_mixin__namespaceContext = None
hash(x)
  _SchemaComponent_mixin__ownedComponents = None
hash(x)
  _SchemaComponent_mixin__owner = None
hash(x)
  _SchemaComponent_mixin__schemaOrderSortKey = None
hash(x)
  _SchemaComponent_mixin__scope = None
hash(x)
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

_namespaceContext(self)

source code 

The namespace context for this schema.

This defines where it looks things up, where it puts things it creates, the in-scope namespace declarations, etc. Must be defined for anything that does any sort of QName interpretation. The value is generally a reference to a namespace context associated with the DOM element node corresponding to this component.

_setScope(self, ctd)

source code 

Set the scope of this instance after construction.

This should only be invoked on cloned declarations being incorporated into a complex type definition. Note that the source of the clone may be any scope: indeterminate if from a model (attribute) group definition; global if a reference to a global component; or ctd if inherited from a complex base type.

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

_dissociateFromNamespace(self)

source code 

Dissociate this component from its owning namespace.

This should only be done whwen there are no other references to the component, and you want to ensure it does not appear in the model.

_setOwner(self, owner)

source code 

Set the owner of this component.

If owner is None, this has no effect. Otherwise, the component's current owner must be either None or the same as the input owner.

_cloneSource(self)

source code 

The source component from which this is a clone.

Returns None if this is not a clone.

_clones(self)

source code 

The set of instances cloned from this component.

Returns None if no instances have been cloned from this.

_resetClone_csc(self, **kw)

source code 

Virtual method to clear whatever attributes should be reset in a cloned component.

This instance should be an instance created by copy.copy().

The implementation in this class clears the owner and dependency relations.

Returns self.

Returns: None
Overrides: namespace._ComponentDependency_mixin._resetClone_csc

_clone(self, owner, origin)

source code 

Create a copy of this instance suitable for adoption by some other component.

This is used for creating a locally-scoped declaration from a declaration in a named model or attribute group.

bestNCName(self)

source code 

Return the name of this component, as best it can be determined.

For example, ModelGroup instances will be named by their ModelGroupDefinition, if available. Returns None if no name can be inferred.

nameInBinding(self)

source code 

Return the name by which this component is known in the generated binding.

Note: To support builtin datatypes, type definitions with an associated pythonSupport class initialize their binding name from the class name when the support association is created. As long as no built-in datatype conflicts with a language keyword, this should be fine.

hasBinding(self)

source code 

Return True iff this is a component which has a user-visible Python construct which serves as its binding.

Type definitions have classes as their bindings. Global element declarations have instances of pyxb.binding.basis.element as their bindings.

_updateFromOther_csc(self, other)

source code 

Override fields in this instance with those from the other.

Post-extended; description in leaf implementation in ComplexTypeDefinition and SimpleTypeDefinition.

Overrides: namespace.archive._ArchivableObject_mixin._updateFromOther_csc

schemaOrderSortKey(self)

source code 

A key to be used when sorting components for binding generation.

This is a tuple comprising the namespace URI, schema location, and line and column of the component definition within the schema. The purpose is to ensure consistent order of binding components in generated code, to simplify maintenance involving the generated sources.

facStateSortKey(self)

source code 

A sort key matching preferred content order.

This is an ordinal (integer) used to control which candidate transitions are attempted first when testing symbols against the content automaton state.

Note: The value associated with a node (especially a ModelGroup or Particle will be different for different complex types, and is valid only during generation of the automata code for a given type.

_setFacStateSortKey(self, key)

source code 

Set the automata state sort key.

Parameters:
  • key - the ordinal used for sorting.

Class Variable Details [hide private]

_SchemaComponent_mixin__PrivateTransient

Value:
set(['cloneSource',
     'clones',
     'facStateSortKey',
     'namespaceContext',
     'ownedComponent',
     'owner'])