1 23 24 29 30 package com.sun.enterprise.tools.common.validation.samples.simple.beans; 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 ChildObjectFour extends org.netbeans.modules.schema2beans.BaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String PROPERTY_ONE = "PropertyOne"; static public final String PROPERTY_TWO = "PropertyTwo"; static public final String PROPERTY_THREE = "PropertyThree"; static public final String PROPERTY_FOUR = "PropertyFour"; 49 public ChildObjectFour() { 50 this(Common.USE_DEFAULT_VALUES); 51 } 52 53 public ChildObjectFour(int options) 54 { 55 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 56 this.createProperty("property-one", PROPERTY_ONE, 59 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 60 String .class); 61 this.createProperty("property-two", PROPERTY_TWO, 63 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 64 String .class); 65 this.createProperty("property-three", PROPERTY_THREE, 67 Common.TYPE_1_N | Common.TYPE_STRING | Common.TYPE_KEY, 68 String .class); 69 this.createProperty("property-four", PROPERTY_FOUR, 71 Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY, 72 String .class); 73 this.initialize(options); 74 } 75 76 void initialize(int options) 78 { 79 80 } 81 82 public void setPropertyOne(String value) { 84 this.setValue(PROPERTY_ONE, value); 85 } 86 87 public String getPropertyOne() { 89 return (String )this.getValue(PROPERTY_ONE); 90 } 91 92 public void setPropertyTwo(String value) { 94 this.setValue(PROPERTY_TWO, value); 95 } 96 97 public String getPropertyTwo() { 99 return (String )this.getValue(PROPERTY_TWO); 100 } 101 102 public void setPropertyThree(int index, String value) { 104 this.setValue(PROPERTY_THREE, index, value); 105 } 106 107 public String getPropertyThree(int index) { 109 return (String )this.getValue(PROPERTY_THREE, index); 110 } 111 112 public void setPropertyThree(String [] value) { 114 this.setValue(PROPERTY_THREE, value); 115 } 116 117 public String [] getPropertyThree() { 119 return (String [])this.getValues(PROPERTY_THREE); 120 } 121 122 public int sizePropertyThree() { 124 return this.size(PROPERTY_THREE); 125 } 126 127 public int addPropertyThree(String value) { 129 return this.addValue(PROPERTY_THREE, value); 130 } 131 132 public int removePropertyThree(String value) { 137 return this.removeValue(PROPERTY_THREE, value); 138 } 139 140 public void setPropertyFour(int index, String value) { 142 this.setValue(PROPERTY_FOUR, index, value); 143 } 144 145 public String getPropertyFour(int index) { 147 return (String )this.getValue(PROPERTY_FOUR, index); 148 } 149 150 public void setPropertyFour(String [] value) { 152 this.setValue(PROPERTY_FOUR, value); 153 } 154 155 public String [] getPropertyFour() { 157 return (String [])this.getValues(PROPERTY_FOUR); 158 } 159 160 public int sizePropertyFour() { 162 return this.size(PROPERTY_FOUR); 163 } 164 165 public int addPropertyFour(String value) { 167 return this.addValue(PROPERTY_FOUR, value); 168 } 169 170 public int removePropertyFour(String value) { 175 return this.removeValue(PROPERTY_FOUR, value); 176 } 177 178 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 180 comparators.add(c); 181 } 182 183 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 185 comparators.remove(c); 186 } 187 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 188 boolean restrictionFailure = false; 189 if (getPropertyOne() == null) { 191 throw new org.netbeans.modules.schema2beans.ValidateException("getPropertyOne() == null", "propertyOne", this); } 193 if (getPropertyTwo() != null) { 195 } 196 if (sizePropertyThree() == 0) { 198 throw new org.netbeans.modules.schema2beans.ValidateException("sizePropertyThree() == 0", "propertyThree", this); } 200 for (int _index = 0; _index < sizePropertyThree(); ++_index) { 201 String element = getPropertyThree(_index); 202 if (element != null) { 203 } 204 } 205 for (int _index = 0; _index < sizePropertyFour(); ++_index) { 207 String element = getPropertyFour(_index); 208 if (element != null) { 209 } 210 } 211 } 212 213 public void dump(StringBuffer str, String indent){ 215 String s; 216 Object o; 217 org.netbeans.modules.schema2beans.BaseBean n; 218 str.append(indent); 219 str.append("PropertyOne"); str.append(indent+"\t"); str.append("<"); s = this.getPropertyOne(); 223 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_ONE, 0, str, indent); 226 227 str.append(indent); 228 str.append("PropertyTwo"); str.append(indent+"\t"); str.append("<"); s = this.getPropertyTwo(); 232 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_TWO, 0, str, indent); 235 236 str.append(indent); 237 str.append("PropertyThree["+this.sizePropertyThree()+"]"); for(int i=0; i<this.sizePropertyThree(); i++) 239 { 240 str.append(indent+"\t"); 241 str.append("#"+i+":"); 242 str.append(indent+"\t"); str.append("<"); s = this.getPropertyThree(i); 245 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_THREE, i, str, indent); 248 } 249 250 str.append(indent); 251 str.append("PropertyFour["+this.sizePropertyFour()+"]"); for(int i=0; i<this.sizePropertyFour(); i++) 253 { 254 str.append(indent+"\t"); 255 str.append("#"+i+":"); 256 str.append(indent+"\t"); str.append("<"); s = this.getPropertyFour(i); 259 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(PROPERTY_FOUR, i, str, indent); 262 } 263 264 } 265 public String dumpBeanNode(){ 266 StringBuffer str = new StringBuffer (); 267 str.append("ChildObjectFour\n"); this.dump(str, "\n "); return str.toString(); 270 }} 271 272 274 275 368 | Popular Tags |