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 SchemaGeneratorProperties extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String PROPERTY = "PropertyElement"; 46 public SchemaGeneratorProperties() { 47 this(Common.USE_DEFAULT_VALUES); 48 } 49 50 public SchemaGeneratorProperties(int options) 51 { 52 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 53 this.createProperty("property", PROPERTY, 56 Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 57 PropertyElement.class); 58 this.initialize(options); 59 } 60 61 void initialize(int options) 63 { 64 65 } 66 67 public void setPropertyElement(int index, PropertyElement value) { 69 this.setValue(PROPERTY, index, value); 70 } 71 72 public PropertyElement getPropertyElement(int index) { 74 return (PropertyElement)this.getValue(PROPERTY, index); 75 } 76 77 public void setPropertyElement(PropertyElement[] value) { 79 this.setValue(PROPERTY, value); 80 } 81 82 public PropertyElement[] getPropertyElement() { 84 return (PropertyElement[])this.getValues(PROPERTY); 85 } 86 87 public int sizePropertyElement() { 89 return this.size(PROPERTY); 90 } 91 92 public int addPropertyElement(com.sun.enterprise.tools.common.dd.ejb.PropertyElement value) { 94 return this.addValue(PROPERTY, value); 95 } 96 97 public int removePropertyElement(com.sun.enterprise.tools.common.dd.ejb.PropertyElement value) { 102 return this.removeValue(PROPERTY, value); 103 } 104 105 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 107 comparators.add(c); 108 } 109 110 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 112 comparators.remove(c); 113 } 114 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 115 boolean restrictionFailure = false; 116 for (int _index = 0; _index < sizePropertyElement(); ++_index) { 118 com.sun.enterprise.tools.common.dd.ejb.PropertyElement element = getPropertyElement(_index); 119 if (element != null) { 120 element.validate(); 121 } 122 } 123 } 124 125 public void dump(StringBuffer str, String indent){ 127 String s; 128 Object o; 129 org.netbeans.modules.schema2beans.BaseBean n; 130 str.append(indent); 131 str.append("PropertyElement["+this.sizePropertyElement()+"]"); for(int i=0; i<this.sizePropertyElement(); i++) 133 { 134 str.append(indent+"\t"); 135 str.append("#"+i+":"); 136 n = (org.netbeans.modules.schema2beans.BaseBean) this.getPropertyElement(i); 137 if (n != null) 138 n.dump(str, indent + "\t"); else 140 str.append(indent+"\tnull"); this.dumpAttributes(PROPERTY, i, str, indent); 142 } 143 144 } 145 public String dumpBeanNode(){ 146 StringBuffer str = new StringBuffer (); 147 str.append("SchemaGeneratorProperties\n"); this.dump(str, "\n "); return str.toString(); 150 }} 151 152 154 155 999 | Popular Tags |