1 4 package com.tc.config.schema.test; 5 6 10 public class L2SConfigBuilder extends BaseConfigBuilder { 11 12 public L2SConfigBuilder() { 13 super(1, new String [] { "servers" }); 14 } 15 16 public void setL2s(String l2s) { 17 setProperty("servers", l2s); 18 } 19 20 public void setL2s(L2ConfigBuilder[] l2s) { 21 setProperty("servers", selfTaggingArray(l2s)); 22 } 23 24 public L2ConfigBuilder[] getL2s() { 25 if (isSet("servers")) return (L2ConfigBuilder[]) ((SelfTaggingArray) getRawProperty("servers")).values(); 26 else return null; 27 } 28 29 public String toString() { 30 if (!isSet("servers")) return ""; 31 else return getProperty("servers").toString(); 32 } 33 34 public static L2SConfigBuilder newMinimalInstance() { 35 L2ConfigBuilder l2 = new L2ConfigBuilder(); 36 l2.setName("localhost"); 37 l2.setDSOPort(9510); 38 39 L2SConfigBuilder out = new L2SConfigBuilder(); 40 out.setL2s(new L2ConfigBuilder[] { l2 }); 41 42 return out; 43 } 44 45 } 46 | Popular Tags |