1 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 []{"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 toString() { 25 return propertyAsString("jee-application"); 26 } 27 28 public SpringApplicationConfigBuilder[] getApplications() { 29 if (isSet("jee-application")) { 30 Object 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 |