org.xnap.commons.settings
Class EnumSetting<T extends Enum<T>>

java.lang.Object
  extended by org.xnap.commons.settings.AbstractSetting<T>
      extended by org.xnap.commons.settings.EnumSetting<T>
All Implemented Interfaces:
Setting<T>

public class EnumSetting<T extends Enum<T>>
extends AbstractSetting<T>

Provides a setting for String objects.


Field Summary
 
Fields inherited from class org.xnap.commons.settings.AbstractSetting
ARRAY_SEPARATOR, backstore
 
Constructor Summary
EnumSetting(SettingResource backend, String key, Class<T> clazz)
           
EnumSetting(SettingResource backend, String key, T defaultValue)
           
 
Method Summary
protected  T fromString(String value)
          Sets the value of the setting from s.
 Class<T> getEnumClass()
           
protected  String toString(T value)
          Returns a string representation of the setting.
 
Methods inherited from class org.xnap.commons.settings.AbstractSetting
addPropertyChangeListener, areObjectsEqual, areObjectsEqual, getDefaultValue, getKey, getProperties, getValidator, getValue, removePropertyChangeListener, revert, setDefaultValue, setProperties, setValidator, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EnumSetting

public EnumSetting(SettingResource backend,
                   String key,
                   T defaultValue)

EnumSetting

public EnumSetting(SettingResource backend,
                   String key,
                   Class<T> clazz)
Method Detail

getEnumClass

public Class<T> getEnumClass()

fromString

protected T fromString(String value)
Description copied from class: AbstractSetting
Sets the value of the setting from s.

Specified by:
fromString in class AbstractSetting<T extends Enum<T>>

toString

protected String toString(T value)
Description copied from class: AbstractSetting
Returns a string representation of the setting. The string is written to the settings file.

Specified by:
toString in class AbstractSetting<T extends Enum<T>>
See Also:
AbstractSetting.fromString(String)


Copyright © 2004-2007 XNap Commons Team. All Rights Reserved.