|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xnap.commons.settings.AbstractSetting<T>
public abstract class AbstractSetting<T>
Provides a default implementation of a setting.
| Field Summary | |
|---|---|
static String |
ARRAY_SEPARATOR
|
protected SettingResource |
backstore
|
| Constructor Summary | |
|---|---|
AbstractSetting(SettingResource backstore,
String key,
T defaultValue,
Validator validator)
|
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(PropertyChangeListener l)
Adds a preferences listener. |
static boolean |
areObjectsEqual(Object[] obj1,
Object[] obj2)
Determine if 2 arrays are equal, or both point to null. |
static boolean |
areObjectsEqual(Object obj1,
Object obj2)
Determine if 2 objects are equal, or both point to null. |
protected abstract T |
fromString(String s)
Sets the value of the setting from s. |
T |
getDefaultValue()
|
String |
getKey()
Returns the unique key used that used to identify the setting. |
SettingResource |
getProperties()
|
Validator |
getValidator()
|
T |
getValue()
|
void |
removePropertyChangeListener(PropertyChangeListener l)
|
void |
revert()
Reverts the setting to its default value. |
protected void |
setDefaultValue(T defaultValue)
|
void |
setProperties(PropertyResource properties)
|
void |
setValidator(Validator validator)
|
void |
setValue(T newValue)
|
protected abstract String |
toString(T object)
Returns a string representation of the setting. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String ARRAY_SEPARATOR
protected SettingResource backstore
| Constructor Detail |
|---|
public AbstractSetting(SettingResource backstore,
String key,
T defaultValue,
Validator validator)
| Method Detail |
|---|
public void addPropertyChangeListener(PropertyChangeListener l)
public static boolean areObjectsEqual(Object obj1,
Object obj2)
public static boolean areObjectsEqual(Object[] obj1,
Object[] obj2)
protected abstract T fromString(String s)
public String getKey()
Setting
getKey in interface Setting<T>public T getDefaultValue()
getDefaultValue in interface Setting<T>public SettingResource getProperties()
public T getValue()
getValue in interface Setting<T>public Validator getValidator()
public void removePropertyChangeListener(PropertyChangeListener l)
public void revert()
Setting
revert in interface Setting<T>protected void setDefaultValue(T defaultValue)
public void setProperties(PropertyResource properties)
public void setValue(T newValue)
setValue in interface Setting<T>public void setValidator(Validator validator)
protected abstract String toString(T object)
fromString(String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||