org.jboss.portal.server.plugins.preferences
Class MergedPreferenceSet

java.lang.Object
  extended by org.jboss.portal.server.plugins.preferences.MergedPreferenceSet
All Implemented Interfaces:
PreferenceSet

public class MergedPreferenceSet
extends java.lang.Object
implements PreferenceSet

Implements a preference set that use an merge strategy.


Constructor Summary
MergedPreferenceSet(PreferenceSet[] sets, MergeStrategy strategy)
           
 
Method Summary
 Preference getPreference(java.lang.String key)
          Return the preference for the given key.
 Value getValue(java.lang.String key)
          Return the value for the given key or null if it does not exist.
 boolean isReadOnly(java.lang.String key)
          Return the read only value for the given preference.
 java.util.Set keySet()
          Return the key set of all the preferences.
 void setReadOnly(java.lang.String key, boolean readOnly)
          Update the read only value for the given key.
 void setValue(java.lang.String key, Value value)
          Update the value of the given key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MergedPreferenceSet

public MergedPreferenceSet(PreferenceSet[] sets,
                           MergeStrategy strategy)
Method Detail

getPreference

public Preference getPreference(java.lang.String key)
Description copied from interface: PreferenceSet
Return the preference for the given key. If no preference exists it must return null.

Specified by:
getPreference in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the requested preference or null if it does not exist

getValue

public Value getValue(java.lang.String key)
Description copied from interface: PreferenceSet
Return the value for the given key or null if it does not exist.

Specified by:
getValue in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the requested value or null if it does not exist

isReadOnly

public boolean isReadOnly(java.lang.String key)
Description copied from interface: PreferenceSet
Return the read only value for the given preference.

Specified by:
isReadOnly in interface PreferenceSet
Parameters:
key - the requested key
Returns:
the read only value

keySet

public java.util.Set keySet()
Description copied from interface: PreferenceSet
Return the key set of all the preferences.

Specified by:
keySet in interface PreferenceSet

setReadOnly

public void setReadOnly(java.lang.String key,
                        boolean readOnly)
Description copied from interface: PreferenceSet
Update the read only value for the given key. Implementation can throw an unsupported operation exception when it is abnormal to perform an update.

Specified by:
setReadOnly in interface PreferenceSet
Parameters:
key - the key to update
readOnly - the new read only value

setValue

public void setValue(java.lang.String key,
                     Value value)
Description copied from interface: PreferenceSet
Update the value of the given key. If the value object is null it means that the preference must be removed. Implementation can throw an unsupported operation exception when it is abnormal to perform an update.

Specified by:
setValue in interface PreferenceSet
Parameters:
key - the key to update
value - the new value