1 19 20 24 25 package org.netbeans.modules.j2ee.sun.validation.data; 26 27 import org.w3c.dom.*; 28 import org.netbeans.modules.schema2beans.*; 29 import java.beans.*; 30 import java.util.*; 31 32 34 public class Parameters extends org.netbeans.modules.schema2beans.BaseBean 35 { 36 37 static Vector comparators = new Vector(); 38 39 static public final String PARAMETER = "Parameter"; 41 public Parameters() { 42 this(Common.USE_DEFAULT_VALUES); 43 } 44 45 public Parameters(int options) 46 { 47 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 48 this.createProperty("parameter", PARAMETER, 51 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 52 Parameter.class); 53 this.initialize(options); 54 } 55 56 void initialize(int options) 58 { 59 60 } 61 62 public void setParameter(int index, Parameter value) { 64 this.setValue(PARAMETER, index, value); 65 } 66 67 public Parameter getParameter(int index) { 69 return (Parameter)this.getValue(PARAMETER, index); 70 } 71 72 public void setParameter(Parameter[] value) { 74 this.setValue(PARAMETER, value); 75 } 76 77 public Parameter[] getParameter() { 79 return (Parameter[])this.getValues(PARAMETER); 80 } 81 82 public int sizeParameter() { 84 return this.size(PARAMETER); 85 } 86 87 public int addParameter(org.netbeans.modules.j2ee.sun.validation.data.Parameter value) { 89 return this.addValue(PARAMETER, value); 90 } 91 92 public int removeParameter(org.netbeans.modules.j2ee.sun.validation.data.Parameter value) { 97 return this.removeValue(PARAMETER, value); 98 } 99 100 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 102 comparators.add(c); 103 } 104 105 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 107 comparators.remove(c); 108 } 109 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 110 boolean restrictionFailure = false; 111 if (sizeParameter() == 0) { 113 throw new org.netbeans.modules.schema2beans.ValidateException("sizeParameter() == 0", "parameter", this); } 115 for (int _index = 0; _index < sizeParameter(); ++_index) { 116 org.netbeans.modules.j2ee.sun.validation.data.Parameter element = getParameter(_index); 117 if (element != null) { 118 element.validate(); 119 } 120 } 121 } 122 123 public void dump(StringBuffer str, String indent){ 125 String s; 126 Object o; 127 org.netbeans.modules.schema2beans.BaseBean n; 128 str.append(indent); 129 str.append("Parameter["+this.sizeParameter()+"]"); for(int i=0; i<this.sizeParameter(); i++) 131 { 132 str.append(indent+"\t"); 133 str.append("#"+i+":"); 134 n = (org.netbeans.modules.schema2beans.BaseBean) this.getParameter(i); 135 if (n != null) 136 n.dump(str, indent + "\t"); else 138 str.append(indent+"\tnull"); this.dumpAttributes(PARAMETER, i, str, indent); 140 } 141 142 } 143 public String dumpBeanNode(){ 144 StringBuffer str = new StringBuffer (); 145 str.append("Parameters\n"); this.dump(str, "\n "); return str.toString(); 148 }} 149 150 152 153 230 | Popular Tags |