KickJava   Java API By Example, From Geeks To Geeks.

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


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
27 public class Param extends BaseBean {
28
29     static Vector comparators = new Vector();
30
31
32     public Param() {
33     this(Common.USE_DEFAULT_VALUES);
34     }
35
36     public Param(String JavaDoc name, String JavaDoc value) {
37     super(Param.comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6));
38     setAttributeValue("name", name); //NOI18N
39
setAttributeValue("value", value); //NOI18N
40
}
41
42     public Param(int options) {
43     super(Param.comparators, new org.netbeans.modules.schema2beans.Version(1, 0, 6));
44     // Properties (see root bean comments for the bean graph)
45
this.initialize(options);
46     }
47
48
49     public String JavaDoc getName() {
50     return getAttributeValue("name"); // NOI18N
51
}
52     public void setName(String JavaDoc value) {
53     setAttributeValue("name", value); // NOI18N
54
}
55
56     public String JavaDoc getValue() {
57     return getAttributeValue("value"); // NOI18N
58
}
59     public void setValue(String JavaDoc value) {
60     setAttributeValue("value", value); // NOI18N
61
}
62
63
64     // Setting the default values of the properties
65
void initialize(int options) {
66
67     }
68
69     // This method verifies that the mandatory properties are set
70
public boolean verify() {
71     return true;
72     }
73
74     //
75
static public void addComparator(BeanComparator c) {
76     Param.comparators.add(c);
77     }
78
79     //
80
static public void removeComparator(BeanComparator c) {
81     Param.comparators.remove(c);
82     }
83     //
84
public void addPropertyChangeListener(PropertyChangeListener l) {
85     BeanProp p = this.beanProp();
86     if (p != null)
87         p.addPCListener(l);
88     }
89
90     //
91
public void removePropertyChangeListener(PropertyChangeListener l) {
92     BeanProp p = this.beanProp();
93     if (p != null)
94         p.removePCListener(l);
95     }
96
97     //
98
public void addPropertyChangeListener(String JavaDoc n, PropertyChangeListener l) {
99     BeanProp p = this.beanProp(n);
100     if (p != null)
101         p.addPCListener(l);
102     }
103
104     //
105
public void removePropertyChangeListener(String JavaDoc n,
106                          PropertyChangeListener l) {
107     BeanProp p = this.beanProp(n);
108     if (p != null)
109         p.removePCListener(l);
110     }
111
112     // Dump the content of this bean returning it as a String
113
public void dump(StringBuffer JavaDoc str, String JavaDoc indent) {
114     String JavaDoc s;
115     BaseBean n;
116     }
117
118     public String JavaDoc dumpBeanNode() {
119     StringBuffer JavaDoc str = new StringBuffer JavaDoc();
120     str.append("Param\n"); //NOI18N
121
this.dump(str, "\n "); //NOI18N
122
return str.toString();
123     }
124 }
125
126
Popular Tags