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 PmDescriptors extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String PM_DESCRIPTOR = "PmDescriptor"; static public final String PM_INUSE = "PmInuse"; 47 public PmDescriptors() { 48 this(Common.USE_DEFAULT_VALUES); 49 } 50 51 public PmDescriptors(int options) 52 { 53 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 54 this.createProperty("pm-descriptor", PM_DESCRIPTOR, 57 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 58 PmDescriptor.class); 59 this.createProperty("pm-inuse", PM_INUSE, 61 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 62 PmInuse.class); 63 this.initialize(options); 64 } 65 66 void initialize(int options) 68 { 69 70 } 71 72 public void setPmDescriptor(int index, PmDescriptor value) { 74 this.setValue(PM_DESCRIPTOR, index, value); 75 } 76 77 public PmDescriptor getPmDescriptor(int index) { 79 return (PmDescriptor)this.getValue(PM_DESCRIPTOR, index); 80 } 81 82 public void setPmDescriptor(PmDescriptor[] value) { 84 this.setValue(PM_DESCRIPTOR, value); 85 } 86 87 public PmDescriptor[] getPmDescriptor() { 89 return (PmDescriptor[])this.getValues(PM_DESCRIPTOR); 90 } 91 92 public int sizePmDescriptor() { 94 return this.size(PM_DESCRIPTOR); 95 } 96 97 public int addPmDescriptor(com.sun.enterprise.tools.common.dd.ejb.PmDescriptor value) { 99 return this.addValue(PM_DESCRIPTOR, value); 100 } 101 102 public int removePmDescriptor(com.sun.enterprise.tools.common.dd.ejb.PmDescriptor value) { 107 return this.removeValue(PM_DESCRIPTOR, value); 108 } 109 110 public void setPmInuse(PmInuse value) { 112 this.setValue(PM_INUSE, value); 113 } 114 115 public PmInuse getPmInuse() { 117 return (PmInuse)this.getValue(PM_INUSE); 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 (sizePmDescriptor() == 0) { 133 throw new org.netbeans.modules.schema2beans.ValidateException("sizePmDescriptor() == 0", "pmDescriptor", this); } 135 for (int _index = 0; _index < sizePmDescriptor(); ++_index) { 136 com.sun.enterprise.tools.common.dd.ejb.PmDescriptor element = getPmDescriptor(_index); 137 if (element != null) { 138 element.validate(); 139 } 140 } 141 if (getPmInuse() == null) { 143 throw new org.netbeans.modules.schema2beans.ValidateException("getPmInuse() == null", "pmInuse", this); } 145 getPmInuse().validate(); 146 } 147 148 public void dump(StringBuffer str, String indent){ 150 String s; 151 Object o; 152 org.netbeans.modules.schema2beans.BaseBean n; 153 str.append(indent); 154 str.append("PmDescriptor["+this.sizePmDescriptor()+"]"); for(int i=0; i<this.sizePmDescriptor(); i++) 156 { 157 str.append(indent+"\t"); 158 str.append("#"+i+":"); 159 n = (org.netbeans.modules.schema2beans.BaseBean) this.getPmDescriptor(i); 160 if (n != null) 161 n.dump(str, indent + "\t"); else 163 str.append(indent+"\tnull"); this.dumpAttributes(PM_DESCRIPTOR, i, str, indent); 165 } 166 167 str.append(indent); 168 str.append("PmInuse"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getPmInuse(); 170 if (n != null) 171 n.dump(str, indent + "\t"); else 173 str.append(indent+"\tnull"); this.dumpAttributes(PM_INUSE, 0, str, indent); 175 176 } 177 public String dumpBeanNode(){ 178 StringBuffer str = new StringBuffer (); 179 str.append("PmDescriptors\n"); this.dump(str, "\n "); return str.toString(); 182 }} 183 184 186 187 1031 | Popular Tags |