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 QueryMethod extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String METHOD_NAME = "MethodName"; static public final String METHOD_PARAMS = "MethodParams"; 24 public QueryMethod() { 25 this(Common.USE_DEFAULT_VALUES); 26 } 27 28 public QueryMethod(int options) 29 { 30 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 31 this.createProperty("method-name", METHOD_NAME, 34 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 35 String .class); 36 this.createProperty("method-params", METHOD_PARAMS, 38 Common.TYPE_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 39 MethodParams.class); 40 this.initialize(options); 41 } 42 43 void initialize(int options) 45 { 46 47 } 48 49 public void setMethodName(String value) { 51 this.setValue(METHOD_NAME, value); 52 } 53 54 public String getMethodName() { 56 return (String )this.getValue(METHOD_NAME); 57 } 58 59 public void setMethodParams(MethodParams value) { 61 this.setValue(METHOD_PARAMS, value); 62 } 63 64 public MethodParams getMethodParams() { 66 return (MethodParams)this.getValue(METHOD_PARAMS); 67 } 68 69 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 71 comparators.add(c); 72 } 73 74 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 76 comparators.remove(c); 77 } 78 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 79 boolean restrictionFailure = false; 80 if (getMethodName() == null) { 82 throw new org.netbeans.modules.schema2beans.ValidateException("getMethodName() == null", "methodName", this); } 84 if (getMethodParams() == null) { 86 throw new org.netbeans.modules.schema2beans.ValidateException("getMethodParams() == null", "methodParams", this); } 88 getMethodParams().validate(); 89 } 90 91 public void dump(StringBuffer str, String indent){ 93 String s; 94 Object o; 95 org.netbeans.modules.schema2beans.BaseBean n; 96 str.append(indent); 97 str.append("MethodName"); str.append(indent+"\t"); str.append("<"); s = this.getMethodName(); 101 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(METHOD_NAME, 0, str, indent); 104 105 str.append(indent); 106 str.append("MethodParams"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams(); 108 if (n != null) 109 n.dump(str, indent + "\t"); else 111 str.append(indent+"\tnull"); this.dumpAttributes(METHOD_PARAMS, 0, str, indent); 113 114 } 115 public String dumpBeanNode(){ 116 StringBuffer str = new StringBuffer (); 117 str.append("QueryMethod\n"); this.dump(str, "\n "); return str.toString(); 120 }} 121 122 124 125 147 | Popular Tags |