KickJava   Java API By Example, From Geeks To Geeks.

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


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.SpringApplicationConfigBuilder;
7 import com.tc.config.schema.builder.SpringConfigBuilder;
8
9
10 public class SpringConfigBuilderImpl extends BaseConfigBuilder implements SpringConfigBuilder {
11
12   protected SpringConfigBuilderImpl() {
13     super(3, new String JavaDoc[]{"jee-application"});
14   }
15
16   public static SpringConfigBuilder newMinimalInstance() {
17     SpringConfigBuilderImpl result = new SpringConfigBuilderImpl();
18
19     result.setApplications(new SpringApplicationConfigBuilderImpl[] { SpringApplicationConfigBuilderImpl.newMinimalInstance() });
20     return result;
21   }
22
23
24   public String JavaDoc toString() {
25     return propertyAsString("jee-application");
26   }
27
28   public SpringApplicationConfigBuilder[] getApplications() {
29     if (isSet("jee-application")) {
30       Object JavaDoc rawProperty = getRawProperty("jee-application");
31       SelfTaggingArray selfTaggingArray = (SelfTaggingArray) rawProperty;
32       return (SpringApplicationConfigBuilder[]) (selfTaggingArray).values();
33     }
34     else return null;
35   }
36
37   private void setApplications(BaseConfigBuilder[] applications) {
38     setProperty("jee-application", selfTaggingArray(applications));
39   }
40 }
41
Popular Tags