View Javadoc

1   /**
2    * 
3    */
4   package net.sf.statcvs.util;
5   
6   import java.util.List;
7   
8   import net.sf.statcvs.output.ConfigurationOptions;
9   
10  /**
11   * @author benoitx
12   *
13   */
14  public final class ModuleUtil {
15      private ModuleUtil() {
16      }
17  
18      /**
19       * returns true if there are some module definitions
20       * <pre>
21      * modules=1,2,3,4
22      * module.1.name=Chart
23      * module.1.regexp=** /charts/ *.java
24      * module.2.name=I/O
25      * module.2.regexp=** /output/ *.java.** /input/ *.java
26      * module.3.name=Model
27      * module.3.regexp=** /model/ *.java|** /renderer/ *.java
28      * module.4.name=Pages
29      * module.4.regexp=** /pages/ ** / *.java,** /reportmodel/ *.java,** /reports/ *.java
30       * </pre>
31       */
32      public static boolean modulesPresent() {
33          return ConfigurationOptions.getConfigStringProperty("modules", null) != null;
34      }
35  
36      public static List getConfigModules() {
37          return ConfigurationOptions.getConfigStringListProperty("modules", null);
38      }
39  
40      public static String getConfigModuleName(final String moduleId) {
41          return ConfigurationOptions.getConfigStringProperty("module." + moduleId + ".name", moduleId);
42      }
43  
44      public static String getConfigModuleRegexp(final String moduleId) {
45          return ConfigurationOptions.getConfigStringProperty("module." + moduleId + ".regexp", null);
46      }
47  }