Package pyxsd :: Package elementRepresentatives :: Module xsdType :: Class XsdType
[hide private]
[frames] | no frames]

Class XsdType

source code

                                 object --+    
                                          |    
elementRepresentative.ElementRepresentative --+
                                              |
                                             XsdType
Known Subclasses:
complexType.ComplexType, simpleType.SimpleType

This class is the base class for SimpleType and ComplexType Subclass of ElementRepresentative. In this class, the classes for all of the types are generated.

Instance Methods [hide private]
  __init__(self, xsdElement, parent)
The __init__ for this class' subclasses.
  getContainingTypeName(self)
Since all types are containing types, this method returns its own name.
  getContainingType(self)
All types are containing types, so this works for all of the XSD types.
  getName(self)
Mostly normal getName(), except it includes a means to make a type name if the type is the child of an element or some other tag.
  containsSchemaBase(self, bases)
Returns true if SchemaBase is in the bases list, false if it is not.
  getBaseList(self, pyXSD)
Creates blank list for the base classes.
  getElements(self)
Returns a blank list.
  clsFor(self, pyXSD)
Produces a class for a schema type.

Inherited from elementRepresentative.ElementRepresentative: __str__, addSuperClassName, checkTopLevelType, describe, findLayerNum, getSchema, processChildren

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


Class Methods [hide private]

Inherited from elementRepresentative.ElementRepresentative: classNameFor, factory, getFromName, register, typeFromName


Static Methods [hide private]

Inherited from elementRepresentative.ElementRepresentative: tryConvert


Properties [hide private]

Inherited from object: __class__


Method Details [hide private]

__init__(self, xsdElement, parent)
(Constructor)

source code 
The __init__ for this class' subclasses. Creates a blank list for enumerations. Creates a blank dictionary for attributes. See ElementRepresentative for documentation.
Overrides: elementRepresentative.ElementRepresentative.__init__

getContainingTypeName(self)

source code 

Since all types are containing types, this method returns its own name.

No parameters.

Overrides: elementRepresentative.ElementRepresentative.getContainingTypeName

getContainingType(self)

source code 

All types are containing types, so this works for all of the XSD types.

No parameters.

Overrides: elementRepresentative.ElementRepresentative.getContainingType

getName(self)

source code 

Mostly normal getName(), except it includes a means to make a type name if the type is the child of an element or some other tag. That name should look like this:

elementName`|`type tag type

No parameters

Overrides: elementRepresentative.ElementRepresentative.getName

containsSchemaBase(self, bases)

source code 

Returns true if SchemaBase is in the bases list, false if it is not. Used by getBaseList()

Parameters:

  • bases- the list of bases for the class that will be created

getBaseList(self, pyXSD)

source code 

Creates blank list for the base classes. It goes through the list of super classes to be added (all type classes), and adds them. Adds SchemaBase, if it is not already added. Returns the list as a tuple, since the type factory must have the bases stored in a tuple, not a list.

Parameters:

  • pyXSD- The PyXSD instance.

getElements(self)

source code 

Returns a blank list. Subclasses uses this function to return elements, but this function is called elsewhere on all of the types.

No parameters.

clsFor(self, pyXSD)

source code 

Produces a class for a schema type. In this class, because this function is only makes classes for tag types that are subclasses of XsdType. Adds functions to the class dictionary to get elements and attributes later on. Calls getBaseList() to generate the list of bases. SchemaBase is in every base list, which will come into play after the class generation. Adds the name and the doc string to the dictionary. Adds the instance of PyXSD to all attributes, elements, and the class dictionary, so it can be accessed later on. In future versions, hopefully this operation will be done in a metaclass.

Parameters:

  • pyXSD- The PyXSD instance.