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

Class AttributeUse

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 --+   |
                                            |   |
       namespace.resolution._Resolvable_mixin --+
                                                |
                               object --+       |
                                        |       |
                                  cscRoot --+   |
                                            |   |
                       _ValueConstraint_mixin --+
                                                |
                                               AttributeUse

An XMLSchema Attribute Use component.

Instance Methods [hide private]
 
required(self) source code
 
prohibited(self) source code
 
restrictionOf(self) source code
 
_setRestrictionOf(self, au) source code
 
attributeDeclaration(self)
The attribute declaration for this use.
source code
 
__init__(self, **kw)
Initialize portions of a component.
source code
 
matchingQNameMembers(self, au_set)
Return the subset of au_set for which the use names match this use.
source code
 
isResolved(self)
Determine whether this named component is resolved.
source code
 
_resolve(self)
Perform whatever steps are required to resolve this component.
source code
frozenset
_bindingRequires_vx(self, include_lax)
Attribute uses require their declarations, but only if lax.
source code
 
_adaptForScope(self, ctd)
Adapt this instance for the given complex type.
source code
 
__str__(self)
str(x)
source code

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

Inherited from namespace._ComponentDependency_mixin: bindingRequires

Inherited from utils.utility.PrivateTransient_mixin: __getstate__

Inherited from _ValueConstraint_mixin: default, fixed, valueConstraint

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

Class Methods [hide private]
 
CreateBaseInstance(cls, schema, attribute_declaration, use=2) source code
 
CreateFromDOM(cls, node, **kw)
Create an Attribute Use from the given DOM node.
source code
Class Variables [hide private]
  __use = None
hash(x)
  USE_required = 1
  USE_optional = 2
  USE_prohibited = 4
  __refAttribute = None
hash(x)
  __restrictionOf = None
hash(x)
  __attributeDeclaration = None
hash(x)

Inherited from _ValueConstraint_mixin: VC_default, VC_fixed, VC_na

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

attributeDeclaration(self)

source code 

The attribute declaration for this use.

When the use scope is assigned, the declaration is cloned (if necessary) so that each declaration corresponds to only one use. We rely on this in code generation, because the template map for the use is stored in its declaration.

__init__(self, **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)

CreateFromDOM(cls, node, **kw)
Class Method

source code 

Create an Attribute Use from the given DOM node.

wxs is a Schema instance within which the attribute use is being defined.

node is a DOM element. The name must be 'attribute', and the node must be in the XMLSchema namespace.

scope is the _ScopeDeclaration_mixin context into which any required anonymous attribute declaration is put. This must be a complex type definition, or None if this use is in an attribute group.

isResolved(self)

source code 

Determine whether this named component is resolved.

Override this in the child class.

Overrides: namespace.resolution._Resolvable_mixin.isResolved
(inherited documentation)

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

_bindingRequires_vx(self, include_lax)

source code 

Attribute uses require their declarations, but only if lax.

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

_adaptForScope(self, ctd)

source code 

Adapt this instance for the given complex type.

If the attribute declaration for this use is not associated with a complex type definition, then associate a clone of it with this CTD, and clone a new attribute use that uses the associated declaration. This attribute use is then inherited by extensions and restrictions, while retaining its original scope.

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)