1 23 24 29 30 package com.sun.enterprise.tools.common.dd.ejb; 31 32 import org.w3c.dom.*; 33 import org.netbeans.modules.schema2beans.*; 34 import java.beans.*; 35 import java.util.*; 36 37 39 public class ActivationConfig extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String DESCRIPTION = "Description"; static public final String ACTIVATION_CONFIG_PROPERTY = "ActivationConfigProperty"; 47 public ActivationConfig() { 48 this(Common.USE_DEFAULT_VALUES); 49 } 50 51 public ActivationConfig(int options) 52 { 53 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 54 this.createProperty("description", DESCRIPTION, 57 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 58 String .class); 59 this.createProperty("activation-config-property", ACTIVATION_CONFIG_PROPERTY, 61 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 62 ActivationConfigProperty.class); 63 this.initialize(options); 64 } 65 66 void initialize(int options) 68 { 69 70 } 71 72 public void setDescription(String value) { 74 this.setValue(DESCRIPTION, value); 75 } 76 77 public String getDescription() { 79 return (String )this.getValue(DESCRIPTION); 80 } 81 82 public void setActivationConfigProperty(int index, ActivationConfigProperty value) { 84 this.setValue(ACTIVATION_CONFIG_PROPERTY, index, value); 85 } 86 87 public ActivationConfigProperty getActivationConfigProperty(int index) { 89 return (ActivationConfigProperty)this.getValue(ACTIVATION_CONFIG_PROPERTY, index); 90 } 91 92 public void setActivationConfigProperty(ActivationConfigProperty[] value) { 94 this.setValue(ACTIVATION_CONFIG_PROPERTY, value); 95 } 96 97 public ActivationConfigProperty[] getActivationConfigProperty() { 99 return (ActivationConfigProperty[])this.getValues(ACTIVATION_CONFIG_PROPERTY); 100 } 101 102 public int sizeActivationConfigProperty() { 104 return this.size(ACTIVATION_CONFIG_PROPERTY); 105 } 106 107 public int addActivationConfigProperty(com.sun.enterprise.tools.common.dd.ejb.ActivationConfigProperty value) { 109 return this.addValue(ACTIVATION_CONFIG_PROPERTY, value); 110 } 111 112 public int removeActivationConfigProperty(com.sun.enterprise.tools.common.dd.ejb.ActivationConfigProperty value) { 117 return this.removeValue(ACTIVATION_CONFIG_PROPERTY, value); 118 } 119 120 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 122 comparators.add(c); 123 } 124 125 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 127 comparators.remove(c); 128 } 129 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 130 boolean restrictionFailure = false; 131 if (getDescription() != null) { 133 } 134 if (sizeActivationConfigProperty() == 0) { 136 throw new org.netbeans.modules.schema2beans.ValidateException("sizeActivationConfigProperty() == 0", "activationConfigProperty", this); } 138 for (int _index = 0; _index < sizeActivationConfigProperty(); 139 ++_index) { 140 com.sun.enterprise.tools.common.dd.ejb.ActivationConfigProperty element = getActivationConfigProperty(_index); 141 if (element != null) { 142 element.validate(); 143 } 144 } 145 } 146 147 public void dump(StringBuffer str, String indent){ 149 String s; 150 Object o; 151 org.netbeans.modules.schema2beans.BaseBean n; 152 str.append(indent); 153 str.append("Description"); str.append(indent+"\t"); str.append("<"); s = this.getDescription(); 157 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(DESCRIPTION, 0, str, indent); 160 161 str.append(indent); 162 str.append("ActivationConfigProperty["+this.sizeActivationConfigProperty()+"]"); for(int i=0; i<this.sizeActivationConfigProperty(); i++) 164 { 165 str.append(indent+"\t"); 166 str.append("#"+i+":"); 167 n = (org.netbeans.modules.schema2beans.BaseBean) this.getActivationConfigProperty(i); 168 if (n != null) 169 n.dump(str, indent + "\t"); else 171 str.append(indent+"\tnull"); this.dumpAttributes(ACTIVATION_CONFIG_PROPERTY, i, str, indent); 173 } 174 175 } 176 public String dumpBeanNode(){ 177 StringBuffer str = new StringBuffer (); 178 str.append("ActivationConfig\n"); this.dump(str, "\n "); return str.toString(); 181 }} 182 183 185 186 1030 | Popular Tags |