1 9 package org.jboss.portal.server.plugins.preferences; 10 11 import java.util.Set ; 12 13 import org.jboss.portal.common.value.Value; 14 15 21 public class MergedPreferenceSet 22 implements PreferenceSet 23 { 24 25 private final MergeStrategy strategy; 26 private final PreferenceSet[] sets; 27 28 public MergedPreferenceSet(PreferenceSet[] sets, MergeStrategy strategy) 29 { 30 this.sets = sets; 31 this.strategy = strategy; 32 } 33 34 public Preference getPreference(String key) 35 { 36 return strategy.getPreference(sets, key); 37 } 38 39 public Value getValue(String key) 40 { 41 Preference pref = getPreference(key); 42 if (pref != null) 43 { 44 return pref.getValue(); 45 } 46 else 47 { 48 return null; 49 } 50 } 51 52 public boolean isReadOnly(String key) 53 { 54 return strategy.isReadOnly(sets, key); 55 } 56 57 public Set keySet() 58 { 59 return strategy.getKeySet(sets); 60 } 61 62 public void setReadOnly(String key, boolean readOnly) 63 { 64 throw new UnsupportedOperationException (); 65 } 66 67 public void setValue(String key, Value value) 68 { 69 throw new UnsupportedOperationException (); 70 } 71 } 72 | Popular Tags |