1 19 20 package org.netbeans.modules.j2ee.sun.validation.constraints.data; 21 22 import org.w3c.dom.*; 23 import org.netbeans.modules.schema2beans.*; 24 import java.beans.*; 25 import java.util.*; 26 27 29 public class Arguments extends org.netbeans.modules.schema2beans.BaseBean 30 { 31 32 static Vector comparators = new Vector(); 33 34 static public final String ARGUMENT = "Argument"; 36 public Arguments() { 37 this(Common.USE_DEFAULT_VALUES); 38 } 39 40 public Arguments(int options) 41 { 42 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 43 this.createProperty("argument", ARGUMENT, 46 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 47 Argument.class); 48 this.initialize(options); 49 } 50 51 void initialize(int options) 53 { 54 55 } 56 57 public void setArgument(int index, Argument value) { 59 this.setValue(ARGUMENT, index, value); 60 } 61 62 public Argument getArgument(int index) { 64 return (Argument)this.getValue(ARGUMENT, index); 65 } 66 67 public void setArgument(Argument[] value) { 69 this.setValue(ARGUMENT, value); 70 } 71 72 public Argument[] getArgument() { 74 return (Argument[])this.getValues(ARGUMENT); 75 } 76 77 public int sizeArgument() { 79 return this.size(ARGUMENT); 80 } 81 82 public int addArgument(org.netbeans.modules.j2ee.sun.validation.constraints.data.Argument value) { 84 return this.addValue(ARGUMENT, value); 85 } 86 87 public int removeArgument(org.netbeans.modules.j2ee.sun.validation.constraints.data.Argument value) { 92 return this.removeValue(ARGUMENT, value); 93 } 94 95 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 97 comparators.add(c); 98 } 99 100 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 102 comparators.remove(c); 103 } 104 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 105 boolean restrictionFailure = false; 106 if (sizeArgument() == 0) { 108 throw new org.netbeans.modules.schema2beans.ValidateException("sizeArgument() == 0", "argument", this); } 110 for (int _index = 0; _index < sizeArgument(); ++_index) { 111 org.netbeans.modules.j2ee.sun.validation.constraints.data.Argument element = getArgument(_index); 112 if (element != null) { 113 element.validate(); 114 } 115 } 116 } 117 118 public void dump(StringBuffer str, String indent){ 120 String s; 121 Object o; 122 org.netbeans.modules.schema2beans.BaseBean n; 123 str.append(indent); 124 str.append("Argument["+this.sizeArgument()+"]"); for(int i=0; i<this.sizeArgument(); i++) 126 { 127 str.append(indent+"\t"); 128 str.append("#"+i+":"); 129 n = (org.netbeans.modules.schema2beans.BaseBean) this.getArgument(i); 130 if (n != null) 131 n.dump(str, indent + "\t"); else 133 str.append(indent+"\tnull"); this.dumpAttributes(ARGUMENT, i, str, indent); 135 } 136 137 } 138 public String dumpBeanNode(){ 139 StringBuffer str = new StringBuffer (); 140 str.append("Arguments\n"); this.dump(str, "\n "); return str.toString(); 143 }} 144 145 147 148 224 | Popular Tags |