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 MethodParams 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_PARAM = "MethodParam"; 49 public MethodParams() { 50 this(Common.USE_DEFAULT_VALUES); 51 } 52 53 public MethodParams(int options) 54 { 55 super(comparators, runtimeVersion); 56 initPropertyTables(1); 58 this.createProperty("method-param", METHOD_PARAM, 60 Common.TYPE_0_N | Common.TYPE_STRING | Common.TYPE_KEY, 61 String .class); 62 this.initialize(options); 63 } 64 65 void initialize(int options) { 67 68 } 69 70 public void setMethodParam(int index, String value) { 72 this.setValue(METHOD_PARAM, index, value); 73 } 74 75 public String getMethodParam(int index) { 77 return (String )this.getValue(METHOD_PARAM, index); 78 } 79 80 public int sizeMethodParam() { 82 return this.size(METHOD_PARAM); 83 } 84 85 public void setMethodParam(String [] value) { 87 this.setValue(METHOD_PARAM, value); 88 } 89 90 public String [] getMethodParam() { 92 return (String [])this.getValues(METHOD_PARAM); 93 } 94 95 public int addMethodParam(String value) { 97 int positionOfNewItem = this.addValue(METHOD_PARAM, value); 98 return positionOfNewItem; 99 } 100 101 public int removeMethodParam(String value) { 106 return this.removeValue(METHOD_PARAM, value); 107 } 108 109 public static void addComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 111 comparators.add(c); 112 } 113 114 public static void removeComparator(org.netbeans.modules.schema2beans.BeanComparator c) { 116 comparators.remove(c); 117 } 118 public void validate() throws org.netbeans.modules.schema2beans.ValidateException { 119 } 120 121 public void dump(StringBuffer str, String indent){ 123 String s; 124 Object o; 125 org.netbeans.modules.schema2beans.BaseBean n; 126 str.append(indent); 127 str.append("MethodParam["+this.sizeMethodParam()+"]"); for(int i=0; i<this.sizeMethodParam(); i++) 129 { 130 str.append(indent+"\t"); 131 str.append("#"+i+":"); 132 str.append(indent+"\t"); str.append("<"); o = this.getMethodParam(i); 135 str.append((o==null?"null":o.toString().trim())); str.append(">\n"); this.dumpAttributes(METHOD_PARAM, i, str, indent); 138 } 139 140 } 141 public String dumpBeanNode(){ 142 StringBuffer str = new StringBuffer (); 143 str.append("MethodParams\n"); this.dump(str, "\n "); return str.toString(); 146 }} 147 148 150 | Popular Tags |