Package esys :: Package escript :: Module modelframe :: Class Link
[show private | hide private]
[frames | no frames]

Class Link


A Link makes an attribute of an object callable:
     o.object()
     o.a=8
     l=Link(o,"a")
     assert l()==8

Method Summary
  __init__(self, target, attribute)
Creates a link to the object target.
  __call__(self, name)
Returns the value of the attribute of the target object.
  __repr__(self)
Returns a string representation of the link.
  fromDom(cls, doc)
(Class method)
  hasDefinedAttributeName(self)
Returns true if an attribute name is set.
  setAttributeName(self, attribute)
Set a new attribute name to be collected from the target object.
  toDom(self, document, node)
toDom method of Link.
  writeXML(self, ostream)
Writes an XML representation of self to the output stream ostream.

Instance Method Details

__init__(self, target, attribute=None)
(Constructor)

Creates a link to the object target. If attribute is given, the link is establised to this attribute of the target. Otherwise the attribute is undefined.

__call__(self, name=None)
(Call operator)

Returns the value of the attribute of the target object. If the atrribute is callable then the return value of the call is returned.

__repr__(self)
(Representation operator)

Returns a string representation of the link.

hasDefinedAttributeName(self)

Returns true if an attribute name is set.

setAttributeName(self, attribute)

Set a new attribute name to be collected from the target object. The target object must have the attribute with name attribute.

toDom(self, document, node)

toDom method of Link. Creates a Link node and appends it to the current XML document.

writeXML(self, ostream=<epydoc.imports._DevNull instance at 0x402244cc>)

Writes an XML representation of self to the output stream ostream. If ostream is nor present the standart output stream is used. If esysheader==True the esys XML header is written

Generated by Epydoc 2.1 on Thu Apr 27 11:16:20 2006 http://epydoc.sf.net