Package gavo :: Package base :: Module structure :: Class ParseableStructure
[frames] | no frames]

Class ParseableStructure

source code

   object --+    
            |    
StructureBase --+
                |
   object --+   |
            |   |
common.Parser --+
                |
               ParseableStructure
Known Subclasses:

is a base class for Structures parseable from EventProcessors (and thus XML).

This is still abstract in that you need at least a name_ attribute. But it knows how to be fed from a parser, plus you have feed and feedObject methods that look up the attribute names and call the methods on the respective attribute definitions.

Nested Classes

Inherited from StructureBase: __metaclass__, name_

Instance Methods
 
__init__(self, parent, **kwargs)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
finishElement(self, ctx) source code
 
getAttribute(self, name)
Returns an attribute instance from name.
source code
 
end_(self, ctx, name, value) source code
 
value_(self, ctx, name, value) source code
 
start_(self, ctx, name, value) source code
 
feed(self, name, literal, ctx=None)
feeds the literal to the attribute name.
source code
 
feedObject(self, name, ob)
feeds the object ob to the attribute name.
source code
 
iterEvents(self)
yields an event sequence that transfers the copyable information from self to something receiving the events.
source code
 
feedFrom(self, other, ctx=None, suppress=set([]))
feeds parsed objects from another structure.
source code
 
__provides__(...)
Special descriptor for class __provides__

Inherited from StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from common.Parser: feedEvent

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

Class Methods

Inherited from StructureBase: fromStructure

Class Variables
  __implemented__ = <implementedBy gavo.base.structure.Parseable...

Inherited from StructureBase: attrSeq, completedCallbacks, managedAttrs

Properties

Inherited from object: __class__

Method Details

__init__(self, parent, **kwargs)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

getAttribute(self, name)

source code 

Returns an attribute instance from name.

This function will raise a StructureError if no matching attribute definition is found.

feed(self, name, literal, ctx=None)

source code 

feeds the literal to the attribute name.

If you do not have a proper parse context ctx, so there may be restrictions on what literals can be fed.

iterEvents(self)

source code 

yields an event sequence that transfers the copyable information from self to something receiving the events.

If something is not copyable, it is ignored (i.e., keeps its default on the target object).

feedFrom(self, other, ctx=None, suppress=set([]))

source code 

feeds parsed objects from another structure.

This only works if the other structure is a of the same or a superclass of self.

__provides__(...)

 

Special descriptor for class __provides__

The descriptor caches the implementedBy info, so that we can get declarations for objects without instance-specific interfaces a bit quicker.

Overrides: common.Parser.__provides__

Class Variable Details

__implemented__

Value:
<implementedBy gavo.base.structure.ParseableStructure>