1 19 20 package org.netbeans.modules.web.monitor.data; 21 22 import org.w3c.dom.*; 23 import org.netbeans.modules.schema2beans.*; 24 import java.beans.*; 25 import java.util.*; 26 27 public class ServletData extends BaseBean { 28 29 static Vector comparators = new Vector(); 30 31 static public final String PARAM = "Param"; 33 public ServletData() { 34 this(Common.USE_DEFAULT_VALUES); 35 } 36 37 public ServletData(int options) { 38 super(ServletData.comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6)); 39 this.createProperty("Param", PARAM, Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 42 Param.class); 43 this.createAttribute(PARAM, "name", "Name", AttrProp.CDATA | AttrProp.REQUIRED, 45 null, null); 46 this.createAttribute(PARAM, "value", "Value", AttrProp.CDATA | AttrProp.IMPLIED, 48 null, null); 49 50 this.initialize(options); 51 } 52 53 void initialize(int options) { 55 } 56 57 58 public void setParam(int index, Param value) { 60 this.setValue(PARAM, index, value); 61 } 62 63 public Param getParam(int index) { 65 return (Param)this.getValue(PARAM, index); 66 } 67 68 public void setParam(Param[] value) { 70 this.setValue(PARAM, value); 71 } 72 73 public Param[] getParam() { 75 return (Param[])this.getValues(PARAM); 76 } 77 78 public int sizeParam() { 80 return this.size(PARAM); 81 } 82 83 public int addParam(Param value) { 85 return this.addValue(PARAM, value); 86 } 87 88 public int removeParam(Param value) { 93 return this.removeValue(PARAM, value); 94 } 95 96 public boolean verify() { 98 return true; 99 } 100 101 static public void addComparator(BeanComparator c) { 103 ServletData.comparators.add(c); 104 } 105 106 static public void removeComparator(BeanComparator c) { 108 ServletData.comparators.remove(c); 109 } 110 public void addPropertyChangeListener(PropertyChangeListener l) { 112 BeanProp p = this.beanProp(); 113 if (p != null) 114 p.addPCListener(l); 115 } 116 117 public void removePropertyChangeListener(PropertyChangeListener l) { 119 BeanProp p = this.beanProp(); 120 if (p != null) 121 p.removePCListener(l); 122 } 123 124 public void addPropertyChangeListener(String n, PropertyChangeListener l) { 126 BeanProp p = this.beanProp(n); 127 if (p != null) 128 p.addPCListener(l); 129 } 130 131 public void removePropertyChangeListener(String n, 133 PropertyChangeListener l) { 134 BeanProp p = this.beanProp(n); 135 if (p != null) 136 p.removePCListener(l); 137 } 138 139 public void dump(StringBuffer str, String indent) { 141 String s; 142 BaseBean n; 143 str.append(indent); 144 str.append("Param["+this.sizeParam()+"]"); for(int i=0; i<this.sizeParam(); i++) 146 { 147 str.append(indent+"\t"); str.append("#"+i+":"); n = this.getParam(i); 150 if (n != null) 151 n.dump(str, indent + "\t"); else 153 str.append(indent+"\tnull"); this.dumpAttributes(PARAM, i, str, indent); 155 } 156 157 } 158 159 public String dumpBeanNode() { 160 StringBuffer str = new StringBuffer (); 161 str.append("ServletData\n"); this.dump(str, "\n "); return str.toString(); 164 } 165 } 166 167 168 | Popular Tags |