Package AccessEngine :: Module AEAccAdapter :: Class AEAccAdapter
[hide private]
[frames] | no frames]

Class AEAccAdapter

source code

object --+
         |
        AEAccAdapter

Base class for all adapter classes.

Has default class attributes indicating the adapter provides no interfaces by default. Has a default constructor that takes and stores the subject being adapted.

Instance Methods [hide private]
 
__init__(self, subject=None)
Stores the subject of the adapter.
source code
object
__call__(self, subject)
Stores the subject of the adapter.
source code

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

Class Variables [hide private]
list of Interface provides = []
Interfaces provided by this adapter
string or callable when = None
Condition under which this adapter is applicable to the given subject.
boolean singleton = False
If True, only one instance of this adapter will be registered for use such that it is reused for all subjects.
Instance Variables [hide private]
object subject
Object being adapted
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, subject=None)
(Constructor)

source code 
Stores the subject of the adapter.
Parameters:
  • subject (object) - Object being adapted
Overrides: object.__init__

__call__(self, subject)
(Call operator)

source code 
Stores the subject of the adapter.
Parameters:
  • subject (object) - Object being adapted
Returns: object
Reference to this instance

Class Variable Details [hide private]

when

Condition under which this adapter is applicable to the given subject.

The condition can either be a staticmethod callable that results in a boolean value or a string that will be evaluated as a boolean Python expression in the namespace in which it is defined. This implies any variables in the global namespace of the AEAccAdapter subclass can be used in the when clause. String conditions are only evaluated once at startup rather than on each call. If the condition is None, the AEAccAdapter is considered a default.
Type:
string or callable
Value:
None

singleton

If True, only one instance of this adapter will be registered for use such that it is reused for all subjects.

If False, this class will be registered for use such that it will act as a factory for producing adapter instances for all subjects.
Type:
boolean
Value:
False