View Javadoc

1   // Copyright (c) 2003, Chad Woolley, All rights reserved.
2   
3   package org.virtualmock.configuration;
4   
5   import java.util.ArrayList;
6   import java.util.List;
7   
8   
9   /***
10   * Class which represents the configuration for a Virtualmock runtime
11   * environment.
12   *
13   * @author Chad Woolley
14   * @version $Revision: 1.5 $
15   *
16   * @todo revisit design of how rules are stored - current method of storing
17   *       types is really just a proof of concept to parse the info out of the
18   *       XML config file.  Also update javadoc.
19   */
20  public class VMConfig {
21      private List classExclusionPatterns = null;
22      private List ruleConfigs = null;
23  
24      /***
25       * Creates a new VMConfig object.
26       */
27      public VMConfig() {
28          classExclusionPatterns = new ArrayList();
29          ruleConfigs = new ArrayList();
30      }
31  
32      /***
33       * Gets patterns specifying classes which should be excluded from
34       * VirtualMock processing.
35       *
36       * @return a List of the class exclusion patterns.
37       */
38      public List getClassExclusionPatterns() {
39          return classExclusionPatterns;
40      }
41  
42      /***
43       * Gets RuleConfigs.
44       *
45       * @return ruleConfigs
46       */
47      public List getRuleConfigs() {
48          return ruleConfigs;
49      }
50  
51      /***
52       * Add a pattern specifying a class or classes which should be excluded
53       * from VirtualMock processing.
54       *
55       * @param classExclusionPattern a string representing a class exclusion
56       *        pattern.
57       */
58      public void addClassExclusionPattern(String classExclusionPattern) {
59          classExclusionPatterns.add(classExclusionPattern);
60      }
61  
62      /***
63       * Add a RuleConfig.
64       *
65       * @param ruleConfig
66       */
67      public void addRuleConfig(RuleConfig ruleConfig) {
68          ruleConfigs.add(ruleConfig);
69      }
70  }