MVCGroupConfiguration.java
01 /*
02  * Copyright 2009-2012 the original author or authors.
03  *
04  * Licensed under the Apache License, Version 2.0 (the "License");
05  * you may not use this file except in compliance with the License.
06  * You may obtain a copy of the License at
07  *
08  *      http://www.apache.org/licenses/LICENSE-2.0
09  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package griffon.core;
18 
19 import java.util.Map;
20 
21 /**
22  * Holds the configuration of an MVC group
23  *
24  @author Andres Almiray
25  @since 0.9.4
26  */
27 public interface MVCGroupConfiguration extends ApplicationHandler {
28     /**
29      * Returns the type of this group.
30      *
31      @return the type of the group.
32      */
33     String getMvcType();
34 
35     /**
36      * Returns a Map with the names of all members keyed by type.
37      *
38      @return a Map of all configured members as defined by the application's configuration or and addon contribution.
39      */
40     Map<String, String> getMembers();
41 
42     /**
43      * Returns a Map with additional configuration for this group.
44      *
45      @return a Map with additional configuration for this group.
46      */
47     Map<String, Object> getConfig();
48 
49     /**
50      * Creates a new MVCGroup instance based in this configuration.
51      * The group's id will should be set to the group's type and an empty Map should be used as the additional arguments.
52      *
53      @return a newly instantiated MVCGroup
54      */
55     MVCGroup create();
56 
57     /**
58      * Creates a new MVCGroup instance based in this configuration.
59      * An empty Map should be used as the additional arguments.
60      *
61      @param mvcId the id to assign to this group
62      @return a newly instantiated MVCGroup
63      */
64     MVCGroup create(String mvcId);
65 
66     /**
67      * Creates a new MVCGroup instance based in this configuration.
68      * The group's id will should be set to the group's type.
69      *
70      @param args additional arguments sent to each member when initializing
71      @return a newly instantiated MVCGroup
72      */
73     MVCGroup create(Map<String, Object> args);
74 
75     /**
76      * Creates a new MVCGroup instance based in this configuration.
77      *
78      @param mvcId the id to assign to this group
79      @param args  additional arguments sent to each member when initializing
80      @return a newly instantiated MVCGroup
81      */
82     MVCGroup create(String mvcId, Map<String, Object> args);
83 }