1 19 26 27 package org.netbeans.modules.j2ee.sun.dd.impl.transform; 28 29 import org.w3c.dom.*; 30 import org.netbeans.modules.schema2beans.*; 31 import java.beans.*; 32 import java.util.*; 33 34 36 public class Xmltype extends org.netbeans.modules.schema2beans.BaseBean 37 { 38 39 static Vector comparators = new Vector(); 40 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(4, 2, 0); 41 42 static public final String NAME = "Name"; static public final String MOD_ELEMENT = "ModElement"; 45 public Xmltype() { 46 this(Common.USE_DEFAULT_VALUES); 47 } 48 49 public Xmltype(int options) 50 { 51 super(comparators, runtimeVersion); 52 initPropertyTables(2); 54 this.createProperty("name", NAME, 56 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 57 String .class); 58 this.createProperty("mod-element", MOD_ELEMENT, 60 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 61 ModElement.class); 62 this.initialize(options); 63 } 64 65 void initialize(int options) { 67 68 } 69 70 public void setName(String value) { 72 this.setValue(NAME, value); 73 } 74 75 public String getName() { 77 return (String )this.getValue(NAME); 78 } 79 80 public void setModElement(int index, ModElement value) { 82 this.setValue(MOD_ELEMENT, index, value); 83 } 84 85 public ModElement getModElement(int index) { 87 return (ModElement)this.getValue(MOD_ELEMENT, index); 88 } 89 90 public int sizeModElement() { 92 return this.size(MOD_ELEMENT); 93 } 94 95 public void setModElement(ModElement[] value) { 97 this.setValue(MOD_ELEMENT, value); 98 } 99 100 public ModElement[] getModElement() { 102 return (ModElement[])this.getValues(MOD_ELEMENT); 103 } 104 105 public int addModElement(ModElement value) { 107 int positionOfNewItem = this.addValue(MOD_ELEMENT, value); 108 return positionOfNewItem; 109 } 110 111 public int removeModElement(ModElement value) { 116 return this.removeValue(MOD_ELEMENT, value); 117 } 118 119 123 public ModElement newModElement() { 124 return new ModElement(); 125 } 126 127 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 129 comparators.add(c); 130 } 131 132 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 134 comparators.remove(c); 135 } 136 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 137 boolean restrictionFailure = false; 138 boolean restrictionPassed = false; 139 if (getName() == null) { 141 throw new org.netbeans.modules.schema2beans.ValidateException("getName() == null", org.netbeans.modules.schema2beans.ValidateException.FailureType.NULL_VALUE, "name", this); } 143 for (int _index = 0; _index < sizeModElement(); ++_index) { 145 ModElement element = getModElement(_index); 146 if (element != null) { 147 element.validate(); 148 } 149 } 150 } 151 152 public void dump(StringBuffer str, String indent){ 154 String s; 155 Object o; 156 org.netbeans.modules.schema2beans.BaseBean n; 157 str.append(indent); 158 str.append("Name"); str.append(indent+"\t"); str.append("<"); o = this.getName(); 162 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(NAME, 0, str, indent); 165 166 str.append(indent); 167 str.append("ModElement["+this.sizeModElement()+"]"); for(int i=0; i<this.sizeModElement(); i++) 169 { 170 str.append(indent+"\t"); 171 str.append("#"+i+":"); 172 n = (org.netbeans.modules.schema2beans.BaseBean) this.getModElement(i); 173 if (n != null) 174 n.dump(str, indent + "\t"); else 176 str.append(indent+"\tnull"); this.dumpAttributes(MOD_ELEMENT, i, str, indent); 178 } 179 180 } 181 public String dumpBeanNode(){ 182 StringBuffer str = new StringBuffer (); 183 str.append("Xmltype\n"); this.dump(str, "\n "); return str.toString(); 186 }} 187 188 190 191 216 | Popular Tags |