KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > config > schema > test > SystemConfigBuilder


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.config.schema.test;
5
6 /**
7  * Allows you to build valid config for the system-global config stuff. This class <strong>MUST NOT</strong> invoke the
8  * actual XML beans to do its work; one of its purposes is, in fact, to test that those beans are set up correctly.
9  */

10 public class SystemConfigBuilder extends BaseConfigBuilder {
11
12   public SystemConfigBuilder() {
13     super(1, ALL_PROPERTIES);
14   }
15
16   public void setLicenseLocation(String JavaDoc value) {
17     setProperty("location", value);
18   }
19
20   public static final String JavaDoc LICENSE_TYPE_NONE = "none";
21   public static final String JavaDoc LICENSE_TYPE_TRIAL = "trial";
22   public static final String JavaDoc LICENSE_TYPE_PRODUCTION = "production";
23
24   public void setLicenseType(String JavaDoc value) {
25     setProperty("type", value);
26   }
27
28   public static final String JavaDoc CONFIG_MODEL_DEVELOPMENT = "development";
29   public static final String JavaDoc CONFIG_MODEL_PRODUCTION = "production";
30
31   public void setConfigurationModel(String JavaDoc value) {
32     setProperty("configuration-model", value);
33   }
34
35   private static final String JavaDoc[] LICENSE = new String JavaDoc[] { "location", "type" };
36   private static final String JavaDoc[] TOP_LEVEL_PROPERTIES = new String JavaDoc[] { "configuration-model" };
37   private static final String JavaDoc[] ALL_PROPERTIES = concat(new Object JavaDoc[] { LICENSE, TOP_LEVEL_PROPERTIES });
38
39   public String JavaDoc toString() {
40     return elementGroup("license", LICENSE) + elements(TOP_LEVEL_PROPERTIES);
41   }
42
43   public static SystemConfigBuilder newMinimalInstance() {
44     return new SystemConfigBuilder();
45   }
46
47 }
Popular Tags