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 Method extends com.sun.enterprise.tools.common.dd.SunBaseBean 17 { 18 19 static Vector comparators = new Vector(); 20 21 static public final String DESCRIPTION = "Description"; static public final String EJB_NAME = "EjbName"; static public final String METHOD_NAME = "MethodName"; static public final String METHOD_INTF = "MethodIntf"; static public final String METHOD_PARAMS = "MethodParams"; 27 public Method() { 28 this(Common.USE_DEFAULT_VALUES); 29 } 30 31 public Method(int options) 32 { 33 super(comparators, new org.netbeans.modules.schema2beans.Version(1, 2, 0)); 34 this.createProperty("description", DESCRIPTION, 37 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 38 String .class); 39 this.createProperty("ejb-name", EJB_NAME, 41 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 42 String .class); 43 this.createProperty("method-name", METHOD_NAME, 45 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 46 String .class); 47 this.createProperty("method-intf", METHOD_INTF, 49 Common.TYPE_0_1 | Common.TYPE_STRING | Common.TYPE_KEY, 50 String .class); 51 this.createProperty("method-params", METHOD_PARAMS, 53 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 54 MethodParams.class); 55 this.initialize(options); 56 } 57 58 void initialize(int options) 60 { 61 62 } 63 64 public void setDescription(String value) { 66 this.setValue(DESCRIPTION, value); 67 } 68 69 public String getDescription() { 71 return (String )this.getValue(DESCRIPTION); 72 } 73 74 public void setEjbName(String value) { 76 this.setValue(EJB_NAME, value); 77 } 78 79 public String getEjbName() { 81 return (String )this.getValue(EJB_NAME); 82 } 83 84 public void setMethodName(String value) { 86 this.setValue(METHOD_NAME, value); 87 } 88 89 public String getMethodName() { 91 return (String )this.getValue(METHOD_NAME); 92 } 93 94 public void setMethodIntf(String value) { 96 this.setValue(METHOD_INTF, value); 97 } 98 99 public String getMethodIntf() { 101 return (String )this.getValue(METHOD_INTF); 102 } 103 104 public void setMethodParams(MethodParams value) { 106 this.setValue(METHOD_PARAMS, value); 107 } 108 109 public MethodParams getMethodParams() { 111 return (MethodParams)this.getValue(METHOD_PARAMS); 112 } 113 114 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 116 comparators.add(c); 117 } 118 119 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 121 comparators.remove(c); 122 } 123 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 124 boolean restrictionFailure = false; 125 if (getDescription() != null) { 127 } 128 if (getEjbName() != null) { 130 } 131 if (getMethodName() == null) { 133 throw new org.netbeans.modules.schema2beans.ValidateException("getMethodName() == null", "methodName", this); } 135 if (getMethodIntf() != null) { 137 } 138 if (getMethodParams() != null) { 140 getMethodParams().validate(); 141 } 142 } 143 144 public void dump(StringBuffer str, String indent){ 146 String s; 147 Object o; 148 org.netbeans.modules.schema2beans.BaseBean n; 149 str.append(indent); 150 str.append("Description"); str.append(indent+"\t"); str.append("<"); s = this.getDescription(); 154 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(DESCRIPTION, 0, str, indent); 157 158 str.append(indent); 159 str.append("EjbName"); str.append(indent+"\t"); str.append("<"); s = this.getEjbName(); 163 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(EJB_NAME, 0, str, indent); 166 167 str.append(indent); 168 str.append("MethodName"); str.append(indent+"\t"); str.append("<"); s = this.getMethodName(); 172 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(METHOD_NAME, 0, str, indent); 175 176 str.append(indent); 177 str.append("MethodIntf"); str.append(indent+"\t"); str.append("<"); s = this.getMethodIntf(); 181 str.append((s==null?"null":s.trim())); str.append(">\n"); this.dumpAttributes(METHOD_INTF, 0, str, indent); 184 185 str.append(indent); 186 str.append("MethodParams"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams(); 188 if (n != null) 189 n.dump(str, indent + "\t"); else 191 str.append(indent+"\tnull"); this.dumpAttributes(METHOD_PARAMS, 0, str, indent); 193 194 } 195 public String dumpBeanNode(){ 196 StringBuffer str = new StringBuffer (); 197 str.append("Method\n"); this.dump(str, "\n "); return str.toString(); 200 }} 201 202 204 205 227 | Popular Tags |