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 OneOneFinders extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String FINDER = "Finder"; 46 public OneOneFinders() { 47 this(Common.USE_DEFAULT_VALUES); 48 } 49 50 public OneOneFinders(int options) 51 { 52 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 53 this.createProperty("finder", FINDER, 56 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 57 Finder.class); 58 this.initialize(options); 59 } 60 61 void initialize(int options) 63 { 64 65 } 66 67 public void setFinder(int index, Finder value) { 69 this.setValue(FINDER, index, value); 70 } 71 72 public Finder getFinder(int index) { 74 return (Finder)this.getValue(FINDER, index); 75 } 76 77 public void setFinder(Finder[] value) { 79 this.setValue(FINDER, value); 80 } 81 82 public Finder[] getFinder() { 84 return (Finder[])this.getValues(FINDER); 85 } 86 87 public int sizeFinder() { 89 return this.size(FINDER); 90 } 91 92 public int addFinder(com.sun.enterprise.tools.common.dd.ejb.Finder value) { 94 return this.addValue(FINDER, value); 95 } 96 97 public int removeFinder(com.sun.enterprise.tools.common.dd.ejb.Finder value) { 102 return this.removeValue(FINDER, 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 if (sizeFinder() == 0) { 118 throw new org.netbeans.modules.schema2beans.ValidateException("sizeFinder() == 0", "finder", this); } 120 for (int _index = 0; _index < sizeFinder(); ++_index) { 121 com.sun.enterprise.tools.common.dd.ejb.Finder element = getFinder(_index); 122 if (element != null) { 123 element.validate(); 124 } 125 } 126 } 127 128 public void dump(StringBuffer str, String indent){ 130 String s; 131 Object o; 132 org.netbeans.modules.schema2beans.BaseBean n; 133 str.append(indent); 134 str.append("Finder["+this.sizeFinder()+"]"); for(int i=0; i<this.sizeFinder(); i++) 136 { 137 str.append(indent+"\t"); 138 str.append("#"+i+":"); 139 n = (org.netbeans.modules.schema2beans.BaseBean) this.getFinder(i); 140 if (n != null) 141 n.dump(str, indent + "\t"); else 143 str.append(indent+"\tnull"); this.dumpAttributes(FINDER, i, str, indent); 145 } 146 147 } 148 public String dumpBeanNode(){ 149 StringBuffer str = new StringBuffer (); 150 str.append("OneOneFinders\n"); this.dump(str, "\n "); return str.toString(); 153 }} 154 155 157 158 1002 | Popular Tags |