object_factory
trestle.core.object_factory
¤
Generic object factory.
Classes¤
ObjectFactory
¤
Allow registration and creation of factory objects.
Source code in trestle/core/object_factory.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
|
Functions¤
__init__()
¤
Initialize the objects dictionary as empty.
Source code in trestle/core/object_factory.py
25 26 27 |
|
get(args)
¤
Create the object from the args.
Source code in trestle/core/object_factory.py
38 39 40 |
|
get_all()
¤
Get all registered objects.
Source code in trestle/core/object_factory.py
42 43 44 |
|
register_object(mode, obj)
¤
Register an object to the object factory.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
mode
|
str
|
Descriptive key for the mode / type of object to be retrieved. |
required |
obj
|
Any
|
The object type to be registered. |
required |
Source code in trestle/core/object_factory.py
29 30 31 32 33 34 35 36 |
|
handler: python