1 | import { IFactory } from './IFactory';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 | export declare class CompositeFactory implements IFactory {
|
20 | private _factories;
|
21 | |
22 |
|
23 |
|
24 |
|
25 |
|
26 | constructor(...factories: IFactory[]);
|
27 | /**
|
28 | * Adds a factory into the list of embedded factories.
|
29 | *
|
30 | * @param factory a factory to be added.
|
31 | */
|
32 | add(factory: IFactory): void;
|
33 | /**
|
34 | * Removes a factory from the list of embedded factories.
|
35 | *
|
36 | * @param factory the factory to remove.
|
37 | */
|
38 | remove(factory: IFactory): void;
|
39 | /**
|
40 | * Checks if this factory is able to create component by given locator.
|
41 | *
|
42 | * This method searches for all registered components and returns
|
43 | * a locator for component it is able to create that matches the given locator.
|
44 | * If the factory is not able to create a requested component is returns null.
|
45 | *
|
46 | * @param locator a locator to identify component to be created.
|
47 | * @returns a locator for a component that the factory is able to create.
|
48 | */
|
49 | canCreate(locator: any): any;
|
50 | /**
|
51 | * Creates a component identified by given locator.
|
52 | *
|
53 | * @param locator a locator to identify component to be created.
|
54 | * @returns the created component.
|
55 | *
|
56 | * @throws a CreateException if the factory is not able to create the component.
|
57 | */
|
58 | create(locator: any): any;
|
59 | }
|