KickJava   Java API By Example, From Geeks To Geeks.

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


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 import com.tc.config.schema.builder.DSOApplicationConfigBuilder;
7 import com.tc.config.schema.builder.SpringConfigBuilder;
8
9 public class ApplicationConfigBuilder extends BaseConfigBuilder {
10
11   public ApplicationConfigBuilder() {
12     super(1, ALL_PROPERTIES);
13   }
14
15   public void setDSO(String JavaDoc value) {
16     setProperty("dso", value);
17   }
18
19   public void setDSO(DSOApplicationConfigBuilder value) {
20     setProperty("dso", value);
21   }
22   
23   public DSOApplicationConfigBuilder getDSO() {
24     if (! isSet("dso")) setDSO(DSOApplicationConfigBuilderImpl.newMinimalInstance());
25     return (DSOApplicationConfigBuilder) getRawProperty("dso");
26   }
27
28   public void setSpring(String JavaDoc value) {
29     setProperty("spring", value);
30   }
31
32   public void setSpring(SpringConfigBuilder value) {
33     setProperty("spring", value);
34   }
35   
36   public SpringConfigBuilder getSpring() {
37     if (! isSet("spring")) setSpring(SpringConfigBuilderImpl.newMinimalInstance());
38     return (SpringConfigBuilder) getRawProperty("spring");
39   }
40
41   private static final String JavaDoc[] ALL_PROPERTIES = new String JavaDoc[] { "dso", "spring" };
42
43   public String JavaDoc toString() {
44     return elements(ALL_PROPERTIES);
45   }
46   
47   public static ApplicationConfigBuilder newMinimalInstance() {
48     return new ApplicationConfigBuilder();
49   }
50
51 }
52
Popular Tags