org.springframework.richclient.settings
Class AbstractSettings

java.lang.Object
  extended by org.springframework.richclient.settings.AbstractSettings
All Implemented Interfaces:
Settings
Direct Known Subclasses:
JdbcSettings, PreferencesSettings, TransientSettings, XmlSettings

public abstract class AbstractSettings
extends Object
implements Settings

Abstract Settings implementation.

Author:
Peter De Bruycker

Constructor Summary
AbstractSettings(Settings parent, String name)
           
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener l)
           
 void addPropertyChangeListener(String key, PropertyChangeListener l)
           
 boolean contains(String key)
           
 String[] getAllKeys()
          Returns the "sum" of {link #getKeys()} and {link #getDefaultKeys()}.
 boolean getBoolean(String key)
           
 String[] getChildSettings()
           
 boolean getDefaultBoolean(String key)
           
 double getDefaultDouble(String key)
           
 float getDefaultFloat(String key)
           
 int getDefaultInt(String key)
           
 String[] getDefaultKeys()
          Returns the registered default keys in this Settings.
 LabeledEnum getDefaultLabeledEnum(String key)
           
 long getDefaultLong(String key)
           
 String getDefaultString(String key)
           
 double getDouble(String key)
           
 float getFloat(String key)
           
 int getInt(String key)
           
 LabeledEnum getLabeledEnum(String key)
           
 long getLong(String key)
           
 String getName()
           
 Settings getParent()
           
 Settings getSettings(String name)
           
 String getString(String key)
           
protected abstract  boolean internalContains(String key)
           
protected abstract  Settings internalCreateChild(String key)
           
protected abstract  String internalGet(String key)
          Return null if no value found for key
protected abstract  String[] internalGetChildSettings()
          Should return the names of the child settings initially in this settings instance, i.e.
protected abstract  void internalRemove(String key)
           
protected abstract  void internalRemoveSettings()
           
protected abstract  void internalSet(String key, String value)
           
 boolean isDefault(String key)
           
 boolean isRoot()
           
 void remove(String key)
           
 void removePropertyChangeListener(PropertyChangeListener l)
           
 void removePropertyChangeListener(String key, PropertyChangeListener l)
           
 void removeSettings()
          Removes this Settings from the backing store.
 void setBoolean(String key, boolean value)
           
 void setDefaultBoolean(String key, boolean value)
           
 void setDefaultDouble(String key, double value)
           
 void setDefaultFloat(String key, float value)
           
 void setDefaultInt(String key, int value)
           
 void setDefaultLabeledEnum(String key, LabeledEnum value)
           
 void setDefaultLong(String key, long value)
           
 void setDefaultString(String key, String value)
           
 void setDouble(String key, double value)
           
 void setFloat(String key, float value)
           
 void setInt(String key, int value)
           
 void setLabeledEnum(String key, LabeledEnum value)
           
 void setLong(String key, long value)
           
 void setString(String key, String value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.springframework.richclient.settings.Settings
getKeys, load, save
 

Constructor Detail

AbstractSettings

public AbstractSettings(Settings parent,
                        String name)
Method Detail

contains

public boolean contains(String key)
Specified by:
contains in interface Settings

internalContains

protected abstract boolean internalContains(String key)

internalGetChildSettings

protected abstract String[] internalGetChildSettings()
Should return the names of the child settings initially in this settings instance, i.e. the children that were stored in the backend.

Returns:
the names of the child settings

setString

public void setString(String key,
                      String value)
Specified by:
setString in interface Settings

internalCreateChild

protected abstract Settings internalCreateChild(String key)

getChildSettings

public String[] getChildSettings()
Specified by:
getChildSettings in interface Settings

getSettings

public Settings getSettings(String name)
Specified by:
getSettings in interface Settings

internalSet

protected abstract void internalSet(String key,
                                    String value)

internalGet

protected abstract String internalGet(String key)
Return null if no value found for key


getString

public String getString(String key)
Specified by:
getString in interface Settings

setDefaultString

public void setDefaultString(String key,
                             String value)
Specified by:
setDefaultString in interface Settings

getDefaultString

public String getDefaultString(String key)
Specified by:
getDefaultString in interface Settings

setInt

public void setInt(String key,
                   int value)
Specified by:
setInt in interface Settings

getInt

public int getInt(String key)
Specified by:
getInt in interface Settings

setDefaultInt

public void setDefaultInt(String key,
                          int value)
Specified by:
setDefaultInt in interface Settings

getDefaultInt

public int getDefaultInt(String key)
Specified by:
getDefaultInt in interface Settings

setDefaultLong

public void setDefaultLong(String key,
                           long value)
Specified by:
setDefaultLong in interface Settings

getDefaultLong

public long getDefaultLong(String key)
Specified by:
getDefaultLong in interface Settings

setFloat

public void setFloat(String key,
                     float value)
Specified by:
setFloat in interface Settings

getFloat

public float getFloat(String key)
Specified by:
getFloat in interface Settings

setDefaultFloat

public void setDefaultFloat(String key,
                            float value)
Specified by:
setDefaultFloat in interface Settings

getDefaultFloat

public float getDefaultFloat(String key)
Specified by:
getDefaultFloat in interface Settings

setDouble

public void setDouble(String key,
                      double value)
Specified by:
setDouble in interface Settings

getDouble

public double getDouble(String key)
Specified by:
getDouble in interface Settings

setDefaultDouble

public void setDefaultDouble(String key,
                             double value)
Specified by:
setDefaultDouble in interface Settings

getDefaultDouble

public double getDefaultDouble(String key)
Specified by:
getDefaultDouble in interface Settings

setBoolean

public void setBoolean(String key,
                       boolean value)
Specified by:
setBoolean in interface Settings

getBoolean

public boolean getBoolean(String key)
Specified by:
getBoolean in interface Settings

setDefaultBoolean

public void setDefaultBoolean(String key,
                              boolean value)
Specified by:
setDefaultBoolean in interface Settings

getDefaultBoolean

public boolean getDefaultBoolean(String key)
Specified by:
getDefaultBoolean in interface Settings

setLabeledEnum

public void setLabeledEnum(String key,
                           LabeledEnum value)
Specified by:
setLabeledEnum in interface Settings

getLabeledEnum

public LabeledEnum getLabeledEnum(String key)
Specified by:
getLabeledEnum in interface Settings

setDefaultLabeledEnum

public void setDefaultLabeledEnum(String key,
                                  LabeledEnum value)
Specified by:
setDefaultLabeledEnum in interface Settings

getDefaultLabeledEnum

public LabeledEnum getDefaultLabeledEnum(String key)
Specified by:
getDefaultLabeledEnum in interface Settings

isDefault

public boolean isDefault(String key)
Specified by:
isDefault in interface Settings

getDefaultKeys

public String[] getDefaultKeys()
Description copied from interface: Settings
Returns the registered default keys in this Settings.

Specified by:
getDefaultKeys in interface Settings
Returns:
the keys

getAllKeys

public String[] getAllKeys()
Description copied from interface: Settings
Returns the "sum" of {link #getKeys()} and {link #getDefaultKeys()}.

Specified by:
getAllKeys in interface Settings
Returns:
all keys

getName

public String getName()
Specified by:
getName in interface Settings

getParent

public Settings getParent()
Specified by:
getParent in interface Settings

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface Settings

addPropertyChangeListener

public void addPropertyChangeListener(String key,
                                      PropertyChangeListener l)
Specified by:
addPropertyChangeListener in interface Settings

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface Settings

removePropertyChangeListener

public void removePropertyChangeListener(String key,
                                         PropertyChangeListener l)
Specified by:
removePropertyChangeListener in interface Settings

internalRemove

protected abstract void internalRemove(String key)

remove

public void remove(String key)
Specified by:
remove in interface Settings

setLong

public void setLong(String key,
                    long value)
Specified by:
setLong in interface Settings

getLong

public long getLong(String key)
Specified by:
getLong in interface Settings

isRoot

public boolean isRoot()
Specified by:
isRoot in interface Settings

removeSettings

public void removeSettings()
Description copied from interface: Settings
Removes this Settings from the backing store.

Specified by:
removeSettings in interface Settings

internalRemoveSettings

protected abstract void internalRemoveSettings()


Copyright © 2004-2008 The Spring Framework. All Rights Reserved.