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 CookiesData extends BaseBean { 28 29 static Vector comparators = new Vector(); 30 31 static public final String COOKIEIN = "CookieIn"; static public final String COOKIEOUT = "CookieOut"; 35 public CookiesData() { 36 this(Common.USE_DEFAULT_VALUES); 37 } 38 39 public CookiesData(int options) { 40 super(RequestData.comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6)); 41 this.createProperty("CookieIn", COOKIEIN, Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 44 CookieIn.class); 45 this.createAttribute(COOKIEIN, "name", "Name", AttrProp.CDATA | AttrProp.REQUIRED, 47 null, null); 48 this.createAttribute(COOKIEIN, "value", "Value", AttrProp.CDATA | AttrProp.IMPLIED, 50 null, null); 51 this.createProperty("CookieOut", COOKIEOUT, Common.TYPE_0_N | Common.TYPE_BEAN | Common.TYPE_KEY, 53 CookieOut.class); 54 this.createAttribute(COOKIEOUT, "name", "Name", AttrProp.CDATA | AttrProp.REQUIRED, 56 null, null); 57 this.createAttribute(COOKIEOUT, "value", "Value", AttrProp.CDATA | AttrProp.REQUIRED, 59 null, null); 60 this.createAttribute(COOKIEOUT, "path", "Path", AttrProp.CDATA | AttrProp.IMPLIED, 62 null, null); 63 this.createAttribute(COOKIEOUT, "domain", "Domain", AttrProp.CDATA | AttrProp.IMPLIED, 65 null, null); 66 this.createAttribute(COOKIEOUT, "maxAge", "MaxAge", AttrProp.NMTOKEN | AttrProp.IMPLIED, 68 null, null); 69 this.createAttribute(COOKIEOUT, "comment", "Comment", AttrProp.CDATA | AttrProp.IMPLIED, 71 null, null); 72 this.createAttribute(COOKIEOUT, "version", "Version", AttrProp.NMTOKEN | AttrProp.IMPLIED, 74 null, null); 75 this.createAttribute(COOKIEOUT, "secure", "Secure", AttrProp.ENUM, 77 new String [] { "false", "true" }, "false"); this.initialize(options); 80 } 81 82 void initialize(int options) { 84 85 } 86 87 public void setCookieIn(int index, CookieIn value) { 89 this.setValue(COOKIEIN, index, value); 90 } 91 92 public CookieIn getCookieIn(int index) { 94 return (CookieIn)this.getValue(COOKIEIN, index); 95 } 96 97 public void setCookieIn(CookieIn[] value) { 99 this.setValue(COOKIEIN, value); 100 } 101 102 public CookieIn[] getCookieIn() { 104 return (CookieIn[])this.getValues(COOKIEIN); 105 } 106 107 public int sizeCookieIn() { 109 return this.size(COOKIEIN); 110 } 111 112 public int addCookieIn(CookieIn value) { 114 return this.addValue(COOKIEIN, value); 115 } 116 117 public int removeCookieIn(CookieIn value) { 122 return this.removeValue(COOKIEIN, value); 123 } 124 125 public void setCookieOut(int index, CookieOut value) { 127 this.setValue(COOKIEOUT, index, value); 128 } 129 130 public CookieOut getCookieOut(int index) { 132 return (CookieOut)this.getValue(COOKIEOUT, index); 133 } 134 135 public void setCookieOut(CookieOut[] value) { 137 this.setValue(COOKIEOUT, value); 138 } 139 140 public CookieOut[] getCookieOut() { 142 return (CookieOut[])this.getValues(COOKIEOUT); 143 } 144 145 public int sizeCookieOut() { 147 return this.size(COOKIEOUT); 148 } 149 150 public int addCookieOut(CookieOut value) { 152 return this.addValue(COOKIEOUT, value); 153 } 154 155 public int removeCookieOut(CookieOut value) { 160 return this.removeValue(COOKIEOUT, value); 161 } 162 163 public boolean verify() { 165 return true; 166 } 167 168 static public void addComparator(BeanComparator c) { 170 ClientData.comparators.add(c); 171 } 172 173 static public void removeComparator(BeanComparator c) { 175 ClientData.comparators.remove(c); 176 } 177 public void addPropertyChangeListener(PropertyChangeListener l) { 179 BeanProp p = this.beanProp(); 180 if (p != null) 181 p.addPCListener(l); 182 } 183 184 public void removePropertyChangeListener(PropertyChangeListener l) { 186 BeanProp p = this.beanProp(); 187 if (p != null) 188 p.removePCListener(l); 189 } 190 191 public void addPropertyChangeListener(String n, PropertyChangeListener l) { 193 BeanProp p = this.beanProp(n); 194 if (p != null) 195 p.addPCListener(l); 196 } 197 198 public void removePropertyChangeListener(String n, 200 PropertyChangeListener l) { 201 BeanProp p = this.beanProp(n); 202 if (p != null) 203 p.removePCListener(l); 204 } 205 206 public void dump(StringBuffer str, String indent) { 208 String s; 209 BaseBean n; 210 211 str.append(indent); 212 str.append("CookieIn["+this.sizeCookieIn()+"]"); for(int i=0; i<this.sizeCookieIn(); i++) 214 { 215 str.append(indent+"\t"); str.append("#"+i+":"); n = this.getCookieIn(i); 218 if (n != null) 219 n.dump(str, indent + "\t"); else 221 str.append(indent+"\tnull"); this.dumpAttributes(COOKIEIN, i, str, indent); 223 } 224 225 str.append(indent); 226 str.append("CookieOut["+this.sizeCookieOut()+"]"); for(int i=0; i<this.sizeCookieOut(); i++) 228 { 229 str.append(indent+"\t"); str.append("#"+i+":"); n = this.getCookieOut(i); 232 if (n != null) 233 n.dump(str, indent + "\t"); else 235 str.append(indent+"\tnull"); this.dumpAttributes(COOKIEOUT, i, str, indent); 237 } 238 239 } 240 241 public String dumpBeanNode() { 242 StringBuffer str = new StringBuffer (); 243 str.append("CookiesData\n"); this.dump(str, "\n "); return str.toString(); 246 } 247 } 248 249 | Popular Tags |