KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > commons > beanutils > MutableDynaClass


1 /*
2  * Copyright 2001-2004 The Apache Software Foundation.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */

16
17 package org.apache.commons.beanutils;
18
19
20
21
22
23 /**
24  * <p>A specialized extension to <code>DynaClass</code> that allows properties
25  * to be added or removed dynamically.</p>
26  *
27  * <p><strong>WARNING</strong> - No guarantees that this will be in the final
28  * APIs ... it's here primarily to preserve some concepts that were in the
29  * original proposal for further discussion.</p>
30  *
31  * @author Craig McClanahan
32  * @author Michael Smith
33  * @author Paulo Gaspar
34  * @version $Revision: 1.8 $ $Date: 2004/02/28 13:18:33 $
35  */

36
37 public interface MutableDynaClass extends DynaClass {
38
39
40     /**
41      * Add a new dynamic property with no restrictions on data type,
42      * readability, or writeability.
43      *
44      * @param name Name of the new dynamic property
45      *
46      * @exception IllegalArgumentException if name is null
47      * @exception IllegalStateException if this DynaClass is currently
48      * restricted, so no new properties can be added
49      */

50     public void add(String JavaDoc name);
51
52
53     /**
54      * Add a new dynamic property with the specified data type, but with
55      * no restrictions on readability or writeability.
56      *
57      * @param name Name of the new dynamic property
58      * @param type Data type of the new dynamic property (null for no
59      * restrictions)
60      *
61      * @exception IllegalArgumentException if name is null
62      * @exception IllegalStateException if this DynaClass is currently
63      * restricted, so no new properties can be added
64      */

65     public void add(String JavaDoc name, Class JavaDoc type);
66
67
68     /**
69      * Add a new dynamic property with the specified data type, readability,
70      * and writeability.
71      *
72      * @param name Name of the new dynamic property
73      * @param type Data type of the new dynamic property (null for no
74      * restrictions)
75      * @param readable Set to <code>true</code> if this property value
76      * should be readable
77      * @param writeable Set to <code>true</code> if this property value
78      * should be writeable
79      *
80      * @exception IllegalArgumentException if name is null
81      * @exception IllegalStateException if this DynaClass is currently
82      * restricted, so no new properties can be added
83      */

84     public void add(String JavaDoc name, Class JavaDoc type, boolean readable,
85                     boolean writeable);
86
87
88     /**
89      * Is this DynaClass currently restricted, if so, no changes to the
90      * existing registration of property names, data types, readability, or
91      * writeability are allowed.
92      */

93     public boolean isRestricted();
94
95
96     /**
97      * Remove the specified dynamic property, and any associated data type,
98      * readability, and writeability, from this dynamic class.
99      * <strong>NOTE</strong> - This does <strong>NOT</strong> cause any
100      * corresponding property values to be removed from DynaBean instances
101      * associated with this DynaClass.
102      *
103      * @param name Name of the dynamic property to remove
104      *
105      * @exception IllegalArgumentException if name is null
106      * @exception IllegalStateException if this DynaClass is currently
107      * restricted, so no properties can be removed
108      */

109     public void remove(String JavaDoc name);
110
111
112     /**
113      * Set the restricted state of this DynaClass to the specified value.
114      *
115      * @param restricted The new restricted state
116      */

117     public void setRestricted(boolean restricted);
118
119
120 }
121
Popular Tags