Documents configuration schemes in more detail
[mkjsf-moved-to-github.git] / src / main / java / com / indexdata / mkjsf / config / Configurable.java
1 package com.indexdata.mkjsf.config;\r
2 \r
3 import java.util.List;\r
4 import java.util.Map;\r
5 \r
6 import com.indexdata.mkjsf.errors.ConfigurationException;\r
7 \r
8 /**\r
9  * Interface to be implemented by any part of an application that wish to\r
10  * use a ConfigurationReader for it's configuration. See config package info page\r
11  * for more information. \r
12  * \r
13  * @author Niels Erik\r
14  *\r
15  */\r
16 public interface Configurable {\r
17 \r
18   /**\r
19    * Configures the Configurable using the configuration obtained by the \r
20    * provided configuration reader\r
21    * @param reader used for reading the configuration \r
22    * @throws ConfigurationException\r
23    */\r
24   public void configure(ConfigurationReader reader) throws ConfigurationException;\r
25   \r
26   /**\r
27    * Returns the default parameters that the configurable has defined for itself\r
28    * Should be invoked by the configuration reader before it possibly overrides\r
29    * some parameters obtained from the external configuration source  \r
30    * @return\r
31    */\r
32   public Map<String,String> getDefaults();\r
33   \r
34   /**\r
35    * Returns the name of the module, can be used by a configuration reader that \r
36    * distinguishes between sets of configuration properties by component name, a\r
37    * name space of sorts.\r
38    * @return name of the part that is to be configured\r
39    */\r
40   public String getModuleName();\r
41   \r
42   /**\r
43    * The components documentation of how it was configured. \r
44    * \r
45    * @return a list of Strings describing configuration details\r
46    */\r
47   public List<String> documentConfiguration(); \r
48   \r
49 }\r