1 4 package com.tc.config.schema.test; 5 6 import com.tc.config.schema.builder.DSOApplicationConfigBuilder; 7 import com.tc.config.schema.builder.InstrumentedClassConfigBuilder; 8 import com.tc.config.schema.builder.LockConfigBuilder; 9 import com.tc.config.schema.builder.RootConfigBuilder; 10 import com.tc.config.schema.builder.SpringConfigBuilder; 11 import com.tc.config.schema.builder.WebApplicationConfigBuilder; 12 13 14 18 public class DSOApplicationConfigBuilderImpl extends BaseConfigBuilder implements DSOApplicationConfigBuilder { 19 20 public DSOApplicationConfigBuilderImpl() { 21 super(4, ALL_PROPERTIES); 22 23 setArrayPropertyTagName("transient-fields", "transient-field"); 24 setArrayPropertyTagName("roots", "root"); 25 setArrayPropertyTagName("distributed-methods", "distributed-method"); 26 setArrayPropertyTagName("additional-boot-jar-classes", "include"); 27 28 setProperty("instrumented-classes", ""); 29 } 30 31 public void setInstrumentedClasses(String value) { 32 setProperty("instrumented-classes", value); 33 } 34 35 public void setInstrumentedClasses(InstrumentedClassConfigBuilder[] value) { 36 setProperty("instrumented-classes", value); 37 } 38 39 public void setDistributedMethods(String value) { 40 setProperty("distributed-methods", value); 41 } 42 43 public void setDistributedMethods(String [] value) { 44 setProperty("distributed-methods", value); 45 } 46 47 public void setAdditionalBootJarClasses(String value) { 48 setProperty("additional-boot-jar-classes", value); 49 } 50 51 public void setAdditionalBootJarClasses(String [] value) { 52 setProperty("additional-boot-jar-classes", value); 53 } 54 55 public void setRoots(String value) { 56 setProperty("roots", value); 57 } 58 59 public void setRoots(RootConfigBuilder[] value) { 60 setProperty("roots", value); 61 } 62 63 public void setTransientFields(String value) { 64 setProperty("transient-fields", value); 65 } 66 67 public void setTransientFields(String [] value) { 68 setProperty("transient-fields", value); 69 } 70 71 public void setLocks(String value) { 72 setProperty("locks", value); 73 } 74 75 public void setLocks(LockConfigBuilder[] value) { 76 setProperty("locks", selfTaggingArray(value)); 77 } 78 79 public void setWebApplications(WebApplicationConfigBuilder[] value) { 80 setProperty("web-applications", selfTaggingArray(value)); 81 } 82 83 private static final String [] ALL_PROPERTIES = new String [] { "instrumented-classes", "transient-fields", "locks", 84 "roots", "distributed-methods", "additional-boot-jar-classes", "web-applications", "spring" }; 85 86 public String toString() { 87 String out = ""; 88 89 out += indent() + elements(ALL_PROPERTIES); 90 91 return out; 92 } 93 94 public static DSOApplicationConfigBuilder newMinimalInstance() { 95 return new DSOApplicationConfigBuilderImpl(); 96 } 97 98 public SpringConfigBuilder getSpring() { 99 if (!isSet("spring")) setSpring(SpringConfigBuilderImpl.newMinimalInstance()); 100 return (SpringConfigBuilder) getRawProperty("spring"); 101 } 102 103 private void setSpring(SpringConfigBuilder builder) { 104 setProperty("spring", builder); 105 106 } 107 108 } 109 | Popular Tags |