Class AbstractToStringProperty.ChildProperty<T>
- java.lang.Object
-
- org.openstreetmap.josm.data.preferences.AbstractProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty<T>
-
- org.openstreetmap.josm.data.preferences.AbstractToStringProperty.ChildProperty<T>
-
- Type Parameters:
T- The content type
- Enclosing class:
- AbstractToStringProperty<T>
public static class AbstractToStringProperty.ChildProperty<T> extends AbstractToStringProperty<T>
This is a version of this property that attempts to get the property with a more specialized key and - if that fails - uses the property value as default.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
AbstractToStringProperty.ChildProperty<T>
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
AbstractProperty.InvalidPreferenceValueException, AbstractProperty.ValueChangeEvent<T>, AbstractProperty.ValueChangeListener<T>
-
-
Field Summary
Fields Modifier and Type Field Description private AbstractToStringProperty<T>parent-
Fields inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
defaultValue, key, preferences
-
-
Constructor Summary
Constructors Constructor Description ChildProperty(AbstractToStringProperty<T> parent, java.lang.String key)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddListenerImpl(PreferenceChangedListener adapter)CachingProperty<T>cached()Creates a newCachingPropertyinstance for this property.protected TfromString(java.lang.String string)Converts the string to an object of the given type.TgetDefaultValue()Replies the default value of this property.protected voidremoveListenerImpl(PreferenceChangedListener adapter)protected voidstoreDefaultValue()Store the default value to the preferences.protected java.lang.StringtoString(T t)Converts the string to an object of the given type.-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractToStringProperty
get, getAsString, getChildProperty, getSpecialized, put
-
Methods inherited from class org.openstreetmap.josm.data.preferences.AbstractProperty
addListener, addWeakListener, equals, getKey, getPreferences, hashCode, isSet, remove, removeListener
-
-
-
-
Field Detail
-
parent
private final AbstractToStringProperty<T> parent
-
-
Constructor Detail
-
ChildProperty
ChildProperty(AbstractToStringProperty<T> parent, java.lang.String key)
-
-
Method Detail
-
storeDefaultValue
protected void storeDefaultValue()
Description copied from class:AbstractPropertyStore the default value to the preferences.- Overrides:
storeDefaultValuein classAbstractProperty<T>
-
getDefaultValue
public T getDefaultValue()
Description copied from class:AbstractPropertyReplies the default value of this property.- Overrides:
getDefaultValuein classAbstractProperty<T>- Returns:
- The default value of this property
-
fromString
protected T fromString(java.lang.String string)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
fromStringin classAbstractToStringProperty<T>- Parameters:
string- The string- Returns:
- The object.
-
toString
protected java.lang.String toString(T t)
Description copied from class:AbstractToStringPropertyConverts the string to an object of the given type.- Specified by:
toStringin classAbstractToStringProperty<T>- Parameters:
t- The object.- Returns:
- The string representing the object
-
addListenerImpl
protected void addListenerImpl(PreferenceChangedListener adapter)
- Overrides:
addListenerImplin classAbstractProperty<T>
-
removeListenerImpl
protected void removeListenerImpl(PreferenceChangedListener adapter)
- Overrides:
removeListenerImplin classAbstractProperty<T>
-
cached
public CachingProperty<T> cached()
Description copied from class:AbstractPropertyCreates a newCachingPropertyinstance for this property.- Overrides:
cachedin classAbstractProperty<T>- Returns:
- The new caching property instance.
-
-