KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > netbeans > modules > web > monitor > data > CookieIn


1 /*
2  * The contents of this file are subject to the terms of the Common Development
3  * and Distribution License (the License). You may not use this file except in
4  * compliance with the License.
5  *
6  * You can obtain a copy of the License at http://www.netbeans.org/cddl.html
7  * or http://www.netbeans.org/cddl.txt.
8  *
9  * When distributing Covered Code, include this CDDL Header Notice in each file
10  * and include the License file at http://www.netbeans.org/cddl.txt.
11  * If applicable, add the following below the CDDL Header, with the fields
12  * enclosed by brackets [] replaced by your own identifying information:
13  * "Portions Copyrighted [year] [name of copyright owner]"
14  *
15  * The Original Software is NetBeans. The Initial Developer of the Original
16  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
17  * Microsystems, Inc. All Rights Reserved.
18  */

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 import javax.servlet.http.Cookie JavaDoc;
27
28 public class CookieIn extends BaseBean {
29
30     static Vector comparators = new Vector();
31
32
33     public CookieIn() {
34     this(Common.USE_DEFAULT_VALUES);
35     }
36
37     public CookieIn(Cookie JavaDoc cookie) {
38     super(comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 5));
39     this.setAttributeValue("name", cookie.getName());//NOI18N
40
this.setAttributeValue("value", cookie.getValue());//NOI18N
41
}
42
43     public CookieIn(String JavaDoc name, String JavaDoc value) {
44     super(comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 5));
45     this.setAttributeValue("name", name);//NOI18N
46
this.setAttributeValue("value", value);//NOI18N
47
}
48
49     public CookieIn(int options) {
50     super(comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6));
51     // Properties (see root bean comments for the bean graph)
52
this.initialize(options);
53     }
54
55     // Setting the default values of the properties
56
void initialize(int options)
57     {
58
59     }
60
61     // This method verifies that the mandatory properties are set
62
public boolean verify()
63     {
64     return true;
65     }
66
67         
68     /**
69        * Get the value of name.
70        * @return Value of name.
71        */

72     public String JavaDoc getName() {return this.getAttributeValue("name");} //NOI18N
73

74     /**
75        * Set the value of Name.
76        * @param v Value to assign to name.
77        */

78     public void setName(String JavaDoc v) {this.setAttributeValue("name", v);} //NOI18N
79

80
81     /**
82        * Get the value of value.
83        * @return Value of value.
84        */

85     public String JavaDoc getValue() {return this.getAttributeValue("value");} //NOI18N
86

87     /**
88        * Set the value of value.
89        * @param v Value to assign to value.
90        */

91     public void setValue(String JavaDoc v) {this.setAttributeValue("value", v);} //NOI18N
92

93     //
94
static public void addComparator(BeanComparator c)
95     {
96     CookieIn.comparators.add(c);
97     }
98
99     //
100
static public void removeComparator(BeanComparator c)
101     {
102     CookieIn.comparators.remove(c);
103     }
104     //
105
public void addPropertyChangeListener(PropertyChangeListener l)
106     {
107     BeanProp p = this.beanProp();
108     if (p != null)
109         p.addPCListener(l);
110     }
111
112     //
113
public void removePropertyChangeListener(PropertyChangeListener l)
114     {
115     BeanProp p = this.beanProp();
116     if (p != null)
117         p.removePCListener(l);
118     }
119
120     //
121
public void addPropertyChangeListener(String JavaDoc n, PropertyChangeListener l)
122     {
123     BeanProp p = this.beanProp(n);
124     if (p != null)
125         p.addPCListener(l);
126     }
127
128     //
129
public void removePropertyChangeListener(String JavaDoc n, PropertyChangeListener l)
130     {
131     BeanProp p = this.beanProp(n);
132     if (p != null)
133         p.removePCListener(l);
134     }
135
136     // Dump the content of this bean returning it as a String
137
public void dump(StringBuffer JavaDoc str, String JavaDoc indent)
138     {
139     String JavaDoc s;
140     BaseBean n;
141     }
142
143     public String JavaDoc dumpBeanNode()
144     {
145     StringBuffer JavaDoc str = new StringBuffer JavaDoc();
146     str.append("CookieIn\n");//NOI18N
147
this.dump(str, "\n ");//NOI18N
148
return str.toString();
149     }
150 }
151
152
Popular Tags