1 | // Copyright 2012 Georg-August-Universität Göttingen, Germany |
---|
2 | // |
---|
3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
---|
4 | // you may not use this file except in compliance with the License. |
---|
5 | // You may obtain a copy of the License at |
---|
6 | // |
---|
7 | // http://www.apache.org/licenses/LICENSE-2.0 |
---|
8 | // |
---|
9 | // Unless required by applicable law or agreed to in writing, software |
---|
10 | // distributed under the License is distributed on an "AS IS" BASIS, |
---|
11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
---|
12 | // See the License for the specific language governing permissions and |
---|
13 | // limitations under the License. |
---|
14 | |
---|
15 | package de.ugoe.cs.autoquest.eventcore; |
---|
16 | |
---|
17 | /** |
---|
18 | * <p> |
---|
19 | * Common interface for event target factories. They are used while constructing hierarchical |
---|
20 | * event target models. |
---|
21 | * </p> |
---|
22 | * |
---|
23 | * @version 1.0 |
---|
24 | * @author Patrick Harms |
---|
25 | */ |
---|
26 | public interface IEventTargetFactory { |
---|
27 | |
---|
28 | /** |
---|
29 | * <p> |
---|
30 | * Instantiates a new {@link IHierarchicalEventTarget} from a given specification. |
---|
31 | * </p> |
---|
32 | * |
---|
33 | * @param specification |
---|
34 | * specification of the new event target |
---|
35 | * @param parent |
---|
36 | * parent of the new event target |
---|
37 | * |
---|
38 | * @return created event target |
---|
39 | * |
---|
40 | * @throws EventTargetModelConfigurationException |
---|
41 | * thrown if there is a problem during the creation of the event target |
---|
42 | */ |
---|
43 | public <T extends IHierarchicalEventTarget> T instantiateEventTarget(IEventTargetSpec specification, |
---|
44 | T parent) |
---|
45 | throws EventTargetModelConfigurationException; |
---|
46 | |
---|
47 | /** |
---|
48 | * <p> |
---|
49 | * Instantiates a new {@link IHierarchicalEventTarget} that represents a group of event targets. |
---|
50 | * The returned object is defined to implement the interface but it must also derive from |
---|
51 | * {@link HierarchicalEventTargetGroup}. This is to ensure type consistency in an event target |
---|
52 | * model but to also allow simple group creations. |
---|
53 | * </p> |
---|
54 | * |
---|
55 | * @param groupName the name of the group to be created |
---|
56 | * @param parent the parent element of the group |
---|
57 | * @param hierarchicalEventTargetModel the model to which the group will belong |
---|
58 | * @return |
---|
59 | */ |
---|
60 | public <T extends IHierarchicalEventTarget> T instantiateGroup(String groupName, |
---|
61 | T parent, |
---|
62 | HierarchicalEventTargetModel<T> hierarchicalEventTargetModel); |
---|
63 | |
---|
64 | } |
---|