1 23 24 31 32 package com.sun.enterprise.tools.common.dd; 33 34 import org.w3c.dom.*; 35 import org.netbeans.modules.schema2beans.*; 36 import java.beans.*; 37 import java.util.*; 38 39 41 public class JavaMethod extends org.netbeans.modules.schema2beans.BaseBean 42 { 43 44 static Vector comparators = new Vector(); 45 private static final org.netbeans.modules.schema2beans.Version runtimeVersion = new org.netbeans.modules.schema2beans.Version(5, 0, 0); 46 47 static public final String METHOD_NAME = "MethodName"; static public final String METHOD_PARAMS = "MethodParams"; 50 public JavaMethod() { 51 this(Common.USE_DEFAULT_VALUES); 52 } 53 54 public JavaMethod(int options) 55 { 56 super(comparators, runtimeVersion); 57 initPropertyTables(2); 59 this.createProperty("method-name", METHOD_NAME, 61 Common.TYPE_1 | Common.TYPE_STRING | Common.TYPE_KEY, 62 String .class); 63 this.createProperty("method-params", METHOD_PARAMS, 65 Common.TYPE_0_1 | Common.TYPE_BEAN | Common.TYPE_KEY, 66 MethodParams.class); 67 this.initialize(options); 68 } 69 70 void initialize(int options) { 72 73 } 74 75 public void setMethodName(String value) { 77 this.setValue(METHOD_NAME, value); 78 } 79 80 public String getMethodName() { 82 return (String )this.getValue(METHOD_NAME); 83 } 84 85 public void setMethodParams(MethodParams value) { 87 this.setValue(METHOD_PARAMS, value); 88 } 89 90 public MethodParams getMethodParams() { 92 return (MethodParams)this.getValue(METHOD_PARAMS); 93 } 94 95 99 public MethodParams newMethodParams() { 100 return new MethodParams(); 101 } 102 103 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 105 comparators.add(c); 106 } 107 108 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 110 comparators.remove(c); 111 } 112 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 113 } 114 115 public void dump(StringBuffer str, String indent){ 117 String s; 118 Object o; 119 org.netbeans.modules.schema2beans.BaseBean n; 120 str.append(indent); 121 str.append("MethodName"); str.append(indent+"\t"); str.append("<"); o = this.getMethodName(); 125 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(METHOD_NAME, 0, str, indent); 128 129 str.append(indent); 130 str.append("MethodParams"); n = (org.netbeans.modules.schema2beans.BaseBean) this.getMethodParams(); 132 if (n != null) 133 n.dump(str, indent + "\t"); else 135 str.append(indent+"\tnull"); this.dumpAttributes(METHOD_PARAMS, 0, str, indent); 137 138 } 139 public String dumpBeanNode(){ 140 StringBuffer str = new StringBuffer (); 141 str.append("JavaMethod\n"); this.dump(str, "\n "); return str.toString(); 144 }} 145 146 148 | Popular Tags |