1 6 7 package com.sun.enterprise.tools.common.dd.ejb; 8 9 import org.w3c.dom.*; 10 import org.netbeans.modules.schema2beans.*; 11 import java.beans.*; 12 import java.util.*; 13 14 16 public class PrefetchDisabled extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String QUERY_METHOD = "QueryMethod"; 23 public PrefetchDisabled() { 24 this(Common.USE_DEFAULT_VALUES); 25 } 26 27 public PrefetchDisabled(int options) 28 { 29 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 30 this.createProperty("query-method", QUERY_METHOD, 33 Common.TYPE_1_N | Common.TYPE_BEAN | Common.TYPE_KEY, 34 QueryMethod.class); 35 this.initialize(options); 36 } 37 38 void initialize(int options) 40 { 41 42 } 43 44 public void setQueryMethod(int index, QueryMethod value) { 46 this.setValue(QUERY_METHOD, index, value); 47 } 48 49 public QueryMethod getQueryMethod(int index) { 51 return (QueryMethod)this.getValue(QUERY_METHOD, index); 52 } 53 54 public void setQueryMethod(QueryMethod[] value) { 56 this.setValue(QUERY_METHOD, value); 57 } 58 59 public QueryMethod[] getQueryMethod() { 61 return (QueryMethod[])this.getValues(QUERY_METHOD); 62 } 63 64 public int sizeQueryMethod() { 66 return this.size(QUERY_METHOD); 67 } 68 69 public int addQueryMethod(com.sun.enterprise.tools.common.dd.ejb.QueryMethod value) { 71 return this.addValue(QUERY_METHOD, value); 72 } 73 74 public int removeQueryMethod(com.sun.enterprise.tools.common.dd.ejb.QueryMethod value) { 79 return this.removeValue(QUERY_METHOD, value); 80 } 81 82 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 84 comparators.add(c); 85 } 86 87 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 89 comparators.remove(c); 90 } 91 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 92 boolean restrictionFailure = false; 93 if (sizeQueryMethod() == 0) { 95 throw new org.netbeans.modules.schema2beans.ValidateException("sizeQueryMethod() == 0", "queryMethod", this); } 97 for (int _index = 0; _index < sizeQueryMethod(); ++_index) { 98 com.sun.enterprise.tools.common.dd.ejb.QueryMethod element = getQueryMethod(_index); 99 if (element != null) { 100 element.validate(); 101 } 102 } 103 } 104 105 public void dump(StringBuffer str, String indent){ 107 String s; 108 Object o; 109 org.netbeans.modules.schema2beans.BaseBean n; 110 str.append(indent); 111 str.append("QueryMethod["+this.sizeQueryMethod()+"]"); for(int i=0; i<this.sizeQueryMethod(); i++) 113 { 114 str.append(indent+"\t"); 115 str.append("#"+i+":"); 116 n = (org.netbeans.modules.schema2beans.BaseBean) this.getQueryMethod(i); 117 if (n != null) 118 n.dump(str, indent + "\t"); else 120 str.append(indent+"\tnull"); this.dumpAttributes(QUERY_METHOD, i, str, indent); 122 } 123 124 } 125 public String dumpBeanNode(){ 126 StringBuffer str = new StringBuffer (); 127 str.append("PrefetchDisabled\n"); this.dump(str, "\n "); return str.toString(); 130 }} 131 132 134 135 157 | Popular Tags |