01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.config.schema.test;
05:
06: import com.tc.config.schema.builder.SpringApplicationConfigBuilder;
07: import com.tc.config.schema.builder.SpringConfigBuilder;
08:
09: public class SpringConfigBuilderImpl extends BaseConfigBuilder
10: implements SpringConfigBuilder {
11:
12: protected SpringConfigBuilderImpl() {
13: super (3, new String[] { "jee-application" });
14: }
15:
16: public static SpringConfigBuilder newMinimalInstance() {
17: SpringConfigBuilderImpl result = new SpringConfigBuilderImpl();
18:
19: result
20: .setApplications(new SpringApplicationConfigBuilderImpl[] { SpringApplicationConfigBuilderImpl
21: .newMinimalInstance() });
22: return result;
23: }
24:
25: public String toString() {
26: return propertyAsString("jee-application");
27: }
28:
29: public SpringApplicationConfigBuilder[] getApplications() {
30: if (isSet("jee-application")) {
31: Object rawProperty = getRawProperty("jee-application");
32: SelfTaggingArray selfTaggingArray = (SelfTaggingArray) rawProperty;
33: return (SpringApplicationConfigBuilder[]) (selfTaggingArray)
34: .values();
35: } else
36: return null;
37: }
38:
39: private void setApplications(BaseConfigBuilder[] applications) {
40: setProperty("jee-application", selfTaggingArray(applications));
41: }
42: }
|