KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > portal > server > plugins > preferences > PreferenceSet


1 /*****************************************
2  * *
3  * JBoss Portal: The OpenSource Portal *
4  * *
5  * Distributable under LGPL license. *
6  * See terms of license at gnu.org. *
7  * *
8  *****************************************/

9 package org.jboss.portal.server.plugins.preferences;
10
11 import java.util.Set JavaDoc;
12
13 import org.jboss.portal.common.value.Value;
14
15 /**
16  * @author <a HREF="mailto:julien@jboss.org">Julien Viet</a>
17  * @version $Revision: 1.2 $
18  */

19 public interface PreferenceSet
20 {
21    /**
22     * Return the key set of all the preferences.
23     */

24    Set JavaDoc keySet();
25
26    /**
27     * Return the preference for the given key. If no preference exists
28     * it must return null.
29     *
30     * @param key the requested key
31     * @return the requested preference or null if it does not exist
32     */

33    Preference getPreference(String JavaDoc key);
34
35    /**
36     * Return the value for the given key or null if it does not exist.
37     *
38     * @param key the requested key
39     * @return the requested value or null if it does not exist
40     */

41    Value getValue(String JavaDoc key);
42
43    /**
44     * Update the value of the given key. If the value object is null
45     * it means that the preference must be removed. Implementation can throw
46     * an unsupported operation exception when it is abnormal to perform an update.
47     *
48     * @param key the key to update
49     * @param value the new value
50     * @throws UnsupportedOperationException if the operation is not supported
51     */

52    void setValue(String JavaDoc key, Value value) throws UnsupportedOperationException JavaDoc;
53
54    /**
55     * Return the read only value for the given preference.
56     *
57     * @param key the requested key
58     * @return the read only value
59     */

60    boolean isReadOnly(String JavaDoc key);
61
62    /**
63     * Update the read only value for the given key. Implementation can throw
64     * an unsupported operation exception when it is abnormal to perform an update.
65     *
66     * @param key the key to update
67     * @param readOnly the new read only value
68     * @throws UnsupportedOperationException if the operation is not supported
69     */

70    void setReadOnly(String JavaDoc key, boolean readOnly) throws UnsupportedOperationException JavaDoc;
71 }
72
Popular Tags