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 Finder extends com.sun.enterprise.tools.common.dd.SunBaseBean 40 { 41 42 static Vector comparators = new Vector(); 43 44 static public final String METHOD_NAME = "MethodName"; static public final String QUERY_PARAMS = "QueryParams"; static public final String QUERY_FILTER = "QueryFilter"; static public final String QUERY_VARIABLES = "QueryVariables"; static public final String QUERY_ORDERING = "QueryOrdering"; 50 public Finder() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public Finder(int options) 55 { 56 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 57 this.createProperty("method-name", METHOD_NAME, 60 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 61 String .class); 62 this.createProperty("query-params", QUERY_PARAMS, 64 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 65 String .class); 66 this.createProperty("query-filter", QUERY_FILTER, 68 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 69 String .class); 70 this.createProperty("query-variables", QUERY_VARIABLES, 72 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 73 String .class); 74 this.createProperty("query-ordering", QUERY_ORDERING, 76 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 77 String .class); 78 this.initialize(options); 79 } 80 81 void initialize(int options) 83 { 84 85 } 86 87 public void setMethodName(String value) { 89 this.setValue(METHOD_NAME, value); 90 } 91 92 public String getMethodName() { 94 return (String )this.getValue(METHOD_NAME); 95 } 96 97 public void setQueryParams(String value) { 99 this.setValue(QUERY_PARAMS, value); 100 } 101 102 public String getQueryParams() { 104 return (String )this.getValue(QUERY_PARAMS); 105 } 106 107 public void setQueryFilter(String value) { 109 this.setValue(QUERY_FILTER, value); 110 } 111 112 public String getQueryFilter() { 114 return (String )this.getValue(QUERY_FILTER); 115 } 116 117 public void setQueryVariables(String value) { 119 this.setValue(QUERY_VARIABLES, value); 120 } 121 122 public String getQueryVariables() { 124 return (String )this.getValue(QUERY_VARIABLES); 125 } 126 127 public void setQueryOrdering(String value) { 129 this.setValue(QUERY_ORDERING, value); 130 } 131 132 public String getQueryOrdering() { 134 return (String )this.getValue(QUERY_ORDERING); 135 } 136 137 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 139 comparators.add(c); 140 } 141 142 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 144 comparators.remove(c); 145 } 146 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 147 boolean restrictionFailure = false; 148 if (getMethodName() == null) { 150 throw new org.netbeans.modules.schema2beans.ValidateException("getMethodName() == null", "methodName", this); } 152 if (getQueryParams() != null) { 154 } 155 if (getQueryFilter() != null) { 157 } 158 if (getQueryVariables() != null) { 160 } 161 if (getQueryOrdering() != null) { 163 } 164 } 165 166 public void dump(StringBuffer str, String indent){ 168 String s; 169 Object o; 170 org.netbeans.modules.schema2beans.BaseBean n; 171 str.append(indent); 172 str.append("MethodName"); str.append(indent+"\t"); str.append("<"); s = this.getMethodName(); 176 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(METHOD_NAME, 0, str, indent); 179 180 str.append(indent); 181 str.append("QueryParams"); str.append(indent+"\t"); str.append("<"); s = this.getQueryParams(); 185 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(QUERY_PARAMS, 0, str, indent); 188 189 str.append(indent); 190 str.append("QueryFilter"); str.append(indent+"\t"); str.append("<"); s = this.getQueryFilter(); 194 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(QUERY_FILTER, 0, str, indent); 197 198 str.append(indent); 199 str.append("QueryVariables"); str.append(indent+"\t"); str.append("<"); s = this.getQueryVariables(); 203 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(QUERY_VARIABLES, 0, str, indent); 206 207 str.append(indent); 208 str.append("QueryOrdering"); str.append(indent+"\t"); str.append("<"); s = this.getQueryOrdering(); 212 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(QUERY_ORDERING, 0, str, indent); 215 216 } 217 public String dumpBeanNode(){ 218 StringBuffer str = new StringBuffer (); 219 str.append("Finder\n"); this.dump(str, "\n "); return str.toString(); 222 }} 223 224 226 227 1071 | Popular Tags |