KickJava   Java API By Example, From Geeks To Geeks.

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


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

5 package com.tc.config.schema.test;
6
7 import com.tc.config.schema.builder.RootConfigBuilder;
8
9 /**
10  * Allows you to build valid config for a root. This class <strong>MUST NOT</strong> invoke the actual XML beans to do
11  * its work; one of its purposes is, in fact, to test that those beans are set up correctly.
12  */

13 public class RootConfigBuilderImpl extends BaseConfigBuilder implements RootConfigBuilder {
14
15   public RootConfigBuilderImpl(Class JavaDoc clazz, String JavaDoc field) {
16     this();
17     setFieldName(clazz.getName() + "." + field);
18   }
19
20   public RootConfigBuilderImpl() {
21     super(4, ALL_PROPERTIES);
22   }
23
24   public void setFieldName(String JavaDoc name) {
25     setProperty("field-name", name);
26   }
27
28   public void setRootName(String JavaDoc name) {
29     setProperty("root-name", name);
30   }
31
32   private static final String JavaDoc[] ALL_PROPERTIES = new String JavaDoc[] { "field-name", "root-name" };
33
34   public String JavaDoc toString() {
35     return elements(ALL_PROPERTIES);
36   }
37
38 }
39
Popular Tags