Package Modeling :: Module delegation :: Class DelegateWrapper
[show private | hide private]
[frames | no frames]

Class DelegateWrapper


The DelegateWrapper:
Method Summary
  __init__(self, interface, object)
Initializes the DelegateWrapper
  __getattr__(self, name)
  delegateObject(self)
Returns the delegate object
  reevaluateDelegateObject(self)
  respondsTo(self, interfaceMethodName)
Tells whether the wrapped delegate object can responds to the method interfaceMethodName as defined in the delegate's interface.
  setDelegateObject(self, object)
Sets the delegate object
  _compileInterface(self)
Inspect the delegate's interface and extracts the necessary methods' names and signatures
  _getClassMethodsSignatures(self, aClass)
Generic function returning a sequence made of couples (<functionName>, <functionSignature>), each couple representing one of aClass 's methods.

Class Variable Summary
NoneType _delegate = None                                                                  

Method Details

__init__(self, interface, object=None)
(Constructor)

Initializes the DelegateWrapper
Parameters:
interface - a class object declaring the methods a delegate may choose to implement
object - optional delegate object. The delegate object can be set or changed later with setDelegateObject()

delegateObject(self)

Returns the delegate object

respondsTo(self, interfaceMethodName)

Tells whether the wrapped delegate object can responds to the method interfaceMethodName as defined in the delegate's interface.

Returned value is None for false, 1 (integer) for true

setDelegateObject(self, object)

Sets the delegate object

_compileInterface(self)

Inspect the delegate's interface and extracts the necessary methods' names and signatures

_getClassMethodsSignatures(self, aClass)

Generic function returning a sequence made of couples (<functionName>, <functionSignature>), each couple representing one of aClass 's methods.

An example of such a couple is (from tests/test_delegation.py):

('canTheWorldBeChanged', "(['self', 'isElvisAlive'], None, None, (1,))")

See also: inspect.getargspec()


Class Variable Details

_delegate

Type:
NoneType
Value:
None                                                                  

Generated by Epydoc 2.1 on Sat Mar 4 13:36:21 2006 http://epydoc.sf.net