org.openstreetmap.josm.data
Class Preferences

java.lang.Object
  extended by org.openstreetmap.josm.data.Preferences
Direct Known Subclasses:
ServerSidePreferences

public class Preferences
extends java.lang.Object

This class holds all preferences for JOSM. Other classes can register their beloved properties here. All properties will be saved upon set-access. Each property is a key=setting pair, where key is a String and setting can be one of 4 types: string, list, list of lists and list of maps. In addition, each key has a unique default value that is set when the value is first accessed using one of the get...() methods. You can use the same preference key in different parts of the code, but the default value must be the same everywhere. A default value of null means, the setting has been requested, but no default value was set. This is used in advanced preferences to present a list off all possible settings. At the moment, you cannot put the empty string for string properties. put(key, "") means, the property is removed.


Nested Class Summary
static class Preferences.AbstractSetting<T>
           
static interface Preferences.ColorKey
           
private static class Preferences.DefaultPreferenceChangeEvent<T>
           
static class Preferences.ListListSetting
           
static class Preferences.ListSetting
           
static class Preferences.MapListSetting
           
static interface Preferences.pref
           
static interface Preferences.PreferenceChangedListener
           
static interface Preferences.PreferenceChangeEvent<T>
           
static interface Preferences.Setting<T>
          Interface for a preference value
private  class Preferences.SettingToXml
           
static interface Preferences.SettingVisitor
           
static class Preferences.StringSetting
           
static interface Preferences.writeExplicitly
           
 
Field Summary
protected  java.util.SortedMap<java.lang.String,java.util.List<java.util.List<java.lang.String>>> arrayDefaults
           
protected  java.util.SortedMap<java.lang.String,java.util.List<java.util.List<java.lang.String>>> arrayProperties
           
private  java.io.File cacheDirFile
          Internal storage for the cache directory.
protected  java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> collectionDefaults
          Defaults, can contain null values
protected  java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> collectionProperties
          Mapping for list settings.
protected  java.util.SortedMap<java.lang.String,java.lang.String> colornames
           
private static java.lang.String[] DEFAULT_PLUGIN_SITE
          The default plugin site
protected  java.util.SortedMap<java.lang.String,java.lang.String> defaults
          Map of defaults, can contain null values
private  java.util.concurrent.CopyOnWriteArrayList<Preferences.PreferenceChangedListener> listeners
           
protected  java.util.SortedMap<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> listOfStructsDefaults
           
protected  java.util.SortedMap<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> listOfStructsProperties
           
protected  javax.xml.stream.XMLStreamReader parser
           
private  java.io.File preferencesDirFile
          Internal storage for the preference directory.
protected  java.util.SortedMap<java.lang.String,java.lang.String> properties
          Map the property name to strings.
 
Constructor Summary
Preferences()
           
 
Method Summary
 void addPreferenceChangeListener(Preferences.PreferenceChangedListener listener)
           
static void copyFile(java.io.File in, java.io.File out)
          Simple file copy function that will overwrite the target file Taken from http://www.rgagnon.com/javadetails/java-0064.html (CC-NC-BY-SA)
static
<T> T
deserializeStruct(java.util.Map<java.lang.String,java.lang.String> hash, java.lang.Class<T> klass)
           
static boolean equalArray(java.util.Collection<java.util.Collection<java.lang.String>> a, java.util.Collection<java.util.List<java.lang.String>> b)
           
static boolean equalCollection(java.util.Collection<java.lang.String> a, java.util.Collection<java.lang.String> b)
           
static boolean equalListOfStructs(java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> a, java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> b)
           
private static boolean equalMap(java.util.Map<java.lang.String,java.lang.String> a, java.util.Map<java.lang.String,java.lang.String> b)
           
protected
<T> void
firePreferenceChanged(java.lang.String key, Preferences.Setting<T> oldValue, Preferences.Setting<T> newValue)
           
 void fromXML(java.io.Reader in)
           
 java.lang.String get(java.lang.String key)
          Get settings value for a certain key.
 java.lang.String get(java.lang.String key, java.lang.String def)
          Get settings value for a certain key and provide default a value.
 java.util.TreeMap<java.lang.String,java.lang.String> getAllColors()
           
 java.util.Map<java.lang.String,Preferences.Setting> getAllDefaults()
           
 java.util.Collection<java.lang.String> getAllPossiblePreferenceDirs()
           
 java.util.Map<java.lang.String,java.lang.String> getAllPrefix(java.lang.String prefix)
           
 java.util.List<java.lang.String> getAllPrefixCollectionKeys(java.lang.String prefix)
           
private  java.util.Map<java.lang.String,java.lang.String> getAllPrefixDefault(java.lang.String prefix)
           
 java.util.Map<java.lang.String,Preferences.Setting> getAllSettings()
           
 java.util.Collection<java.util.Collection<java.lang.String>> getArray(java.lang.String key)
           
 java.util.Collection<java.util.Collection<java.lang.String>> getArray(java.lang.String key, java.util.Collection<java.util.Collection<java.lang.String>> def)
          Used to read a 2-dimensional array of strings from the preference file.
private  java.util.List<java.util.List<java.lang.String>> getArrayInternal(java.lang.String key)
           
 boolean getBoolean(java.lang.String key)
           
 boolean getBoolean(java.lang.String key, boolean def)
           
 boolean getBoolean(java.lang.String key, java.lang.String specName, boolean def)
           
 java.io.File getCacheDirectory()
           
 java.util.Collection<java.lang.String> getCollection(java.lang.String key)
          Get a list of values for a certain key
 java.util.Collection<java.lang.String> getCollection(java.lang.String key, java.util.Collection<java.lang.String> def)
          Get a list of values for a certain key
private  java.util.List<java.lang.String> getCollectionInternal(java.lang.String key)
           
 java.awt.Color getColor(Preferences.ColorKey key)
           
 java.awt.Color getColor(java.lang.String colName, java.awt.Color def)
          Convenience method for accessing colour preferences.
 java.awt.Color getColor(java.lang.String colName, java.lang.String specName, java.awt.Color def)
          Convenience method for accessing colour preferences.
 java.lang.String getColorName(java.lang.String o)
           
 java.awt.Color getDefaultColor(java.lang.String colKey)
           
 java.util.Map<java.lang.String,java.lang.String> getDefaults()
           
 double getDouble(java.lang.String key, double def)
           
 double getDouble(java.lang.String key, java.lang.String def)
           
 int getInteger(java.lang.String key, int def)
           
 int getInteger(java.lang.String key, java.lang.String specName, int def)
           
<T> java.util.List<T>
getListOfStructs(java.lang.String key, java.lang.Class<T> klass)
          Get a list of hashes which are represented by a struct-like class.
 java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> getListOfStructs(java.lang.String key, java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> def)
           
<T> java.util.List<T>
getListOfStructs(java.lang.String key, java.util.Collection<T> def, java.lang.Class<T> klass)
          same as above, but returns def if nothing was found
private  java.util.List<java.util.Map<java.lang.String,java.lang.String>> getListOfStructsInternal(java.lang.String key)
           
 long getLong(java.lang.String key, long def)
           
 java.io.File getOldPreferenceFile()
           
 java.io.File getPluginsDirectory()
           
 java.util.Collection<java.lang.String> getPluginSites()
          Replies the collection of plugin site URLs from where plugin lists can be downloaded
 java.io.File getPreferenceFile()
           
 java.lang.String getPreferencesDir()
          Return the location of the user defined preferences file
 java.io.File getPreferencesDirFile()
           
 java.awt.Color getUIColor(java.lang.String colName)
           
 void init(boolean reset)
           
static boolean isEqual(Preferences.Setting a, Preferences.Setting b)
           
private  void jumpToEnd()
           
 void load()
           
private  void load(boolean old)
           
 void loadOld()
           
 void parse()
           
protected  java.util.List<java.lang.String> parseInnerList()
           
protected  java.util.Map<java.lang.String,java.lang.String> parseMap()
           
 void parseRoot()
           
protected  void parseToplevelList()
           
 boolean put(java.lang.String key, boolean value)
           
 boolean put(java.lang.String key, java.lang.String value)
          Set a value for a certain setting.
 boolean putArray(java.lang.String key, java.util.Collection<java.util.Collection<java.lang.String>> value)
           
private  void putArrayDefault(java.lang.String key, java.util.List<java.util.List<java.lang.String>> val)
           
 boolean putCollection(java.lang.String key, java.util.Collection<java.lang.String> value)
           
 boolean putCollectionBounded(java.lang.String key, int maxsize, java.util.Collection<java.lang.String> val)
          Saves at most maxsize items of collection val.
private  void putCollectionDefault(java.lang.String key, java.util.List<java.lang.String> val)
           
 boolean putColor(java.lang.String colKey, java.awt.Color val)
           
 void putDefault(java.lang.String key, java.lang.String def)
           
 boolean putDouble(java.lang.String key, java.lang.Double value)
           
 boolean putInteger(java.lang.String key, java.lang.Integer value)
           
 boolean putListOfStructs(java.lang.String key, java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> value)
           
<T> boolean
putListOfStructs(java.lang.String key, java.util.Collection<T> val, java.lang.Class<T> klass)
          Save a list of hashes represented by a struct-like class.
private  void putListOfStructsDefault(java.lang.String key, java.util.List<java.util.Map<java.lang.String,java.lang.String>> val)
           
 boolean putLong(java.lang.String key, java.lang.Long value)
           
 boolean putSetting(java.lang.String key, Preferences.Setting value)
           
 void removeFromCollection(java.lang.String key, java.lang.String value)
           
 void removeObsolete()
          Removes obsolete preference settings.
 void removePreferenceChangeListener(Preferences.PreferenceChangedListener listener)
           
 void resetToDefault()
           
 void save()
          Called after every put.
private
<T> java.util.Collection<java.util.Map<java.lang.String,java.lang.String>>
serializeListOfStructs(java.util.Collection<T> l, java.lang.Class<T> klass)
           
static
<T> java.util.Map<java.lang.String,java.lang.String>
serializeStruct(T struct, java.lang.Class<T> klass)
           
private  void setCorrectPermissions(java.io.File file)
           
 void setPluginSites(java.util.Collection<java.lang.String> sites)
          Sets the collection of plugin site URLs.
protected  void throwException(java.lang.String msg)
           
 java.lang.String toXML(boolean nopass)
           
 void updateSystemProperties()
          Updates system properties with the current values in the preferences.
private  void updateSystemProperty(java.lang.String key, java.lang.String value)
           
 void validateXML(java.io.Reader in)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

preferencesDirFile

private java.io.File preferencesDirFile
Internal storage for the preference directory. Do not access this variable directly!

See Also:
getPreferencesDirFile()

cacheDirFile

private java.io.File cacheDirFile
Internal storage for the cache directory.


properties

protected final java.util.SortedMap<java.lang.String,java.lang.String> properties
Map the property name to strings. Does not contain null or "" values.


defaults

protected final java.util.SortedMap<java.lang.String,java.lang.String> defaults
Map of defaults, can contain null values


colornames

protected final java.util.SortedMap<java.lang.String,java.lang.String> colornames

collectionProperties

protected final java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> collectionProperties
Mapping for list settings. Must not contain null values


collectionDefaults

protected final java.util.SortedMap<java.lang.String,java.util.List<java.lang.String>> collectionDefaults
Defaults, can contain null values


arrayProperties

protected final java.util.SortedMap<java.lang.String,java.util.List<java.util.List<java.lang.String>>> arrayProperties

arrayDefaults

protected final java.util.SortedMap<java.lang.String,java.util.List<java.util.List<java.lang.String>>> arrayDefaults

listOfStructsProperties

protected final java.util.SortedMap<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> listOfStructsProperties

listOfStructsDefaults

protected final java.util.SortedMap<java.lang.String,java.util.List<java.util.Map<java.lang.String,java.lang.String>>> listOfStructsDefaults

listeners

private final java.util.concurrent.CopyOnWriteArrayList<Preferences.PreferenceChangedListener> listeners

DEFAULT_PLUGIN_SITE

private static final java.lang.String[] DEFAULT_PLUGIN_SITE
The default plugin site


parser

protected javax.xml.stream.XMLStreamReader parser
Constructor Detail

Preferences

public Preferences()
Method Detail

addPreferenceChangeListener

public void addPreferenceChangeListener(Preferences.PreferenceChangedListener listener)

removePreferenceChangeListener

public void removePreferenceChangeListener(Preferences.PreferenceChangedListener listener)

firePreferenceChanged

protected <T> void firePreferenceChanged(java.lang.String key,
                                         Preferences.Setting<T> oldValue,
                                         Preferences.Setting<T> newValue)

getPreferencesDir

public java.lang.String getPreferencesDir()
Return the location of the user defined preferences file


getPreferencesDirFile

public java.io.File getPreferencesDirFile()

getPreferenceFile

public java.io.File getPreferenceFile()

getOldPreferenceFile

public java.io.File getOldPreferenceFile()

getPluginsDirectory

public java.io.File getPluginsDirectory()

getCacheDirectory

public java.io.File getCacheDirectory()

getAllPossiblePreferenceDirs

public java.util.Collection<java.lang.String> getAllPossiblePreferenceDirs()
Returns:
A list of all existing directories where resources could be stored.

get

public java.lang.String get(java.lang.String key)
Get settings value for a certain key.

Parameters:
key - the identifier for the setting
Returns:
"" if there is nothing set for the preference key, the corresponding value otherwise. The result is not null.

get

public java.lang.String get(java.lang.String key,
                            java.lang.String def)
Get settings value for a certain key and provide default a value.

Parameters:
key - the identifier for the setting
def - the default value. For each call of get() with a given key, the default value must be the same.
Returns:
the corresponding value if the property has been set before, def otherwise

getAllPrefix

public java.util.Map<java.lang.String,java.lang.String> getAllPrefix(java.lang.String prefix)

getAllPrefixCollectionKeys

public java.util.List<java.lang.String> getAllPrefixCollectionKeys(java.lang.String prefix)

getAllPrefixDefault

private java.util.Map<java.lang.String,java.lang.String> getAllPrefixDefault(java.lang.String prefix)

getAllColors

public java.util.TreeMap<java.lang.String,java.lang.String> getAllColors()

getDefaults

public java.util.Map<java.lang.String,java.lang.String> getDefaults()

putDefault

public void putDefault(java.lang.String key,
                       java.lang.String def)

getBoolean

public boolean getBoolean(java.lang.String key)

getBoolean

public boolean getBoolean(java.lang.String key,
                          boolean def)

getBoolean

public boolean getBoolean(java.lang.String key,
                          java.lang.String specName,
                          boolean def)

put

public boolean put(java.lang.String key,
                   java.lang.String value)
Set a value for a certain setting. The changed setting is saved to the preference file immediately. Due to caching mechanisms on modern operating systems and hardware, this shouldn't be a performance problem.

Parameters:
key - the unique identifier for the setting
value - the value of the setting. Can be null or "" which both removes the key-value entry.
Returns:
if true, something has changed (i.e. value is different than before)

put

public boolean put(java.lang.String key,
                   boolean value)

putInteger

public boolean putInteger(java.lang.String key,
                          java.lang.Integer value)

putDouble

public boolean putDouble(java.lang.String key,
                         java.lang.Double value)

putLong

public boolean putLong(java.lang.String key,
                       java.lang.Long value)

save

public void save()
          throws java.io.IOException
Called after every put. In case of a problem, do nothing but output the error in log.

Throws:
java.io.IOException

setCorrectPermissions

private void setCorrectPermissions(java.io.File file)

copyFile

public static void copyFile(java.io.File in,
                            java.io.File out)
                     throws java.io.IOException
Simple file copy function that will overwrite the target file Taken from http://www.rgagnon.com/javadetails/java-0064.html (CC-NC-BY-SA)

Parameters:
in -
out -
Throws:
java.io.IOException

loadOld

public void loadOld()
             throws java.lang.Exception
Throws:
java.lang.Exception

load

public void load()
          throws java.lang.Exception
Throws:
java.lang.Exception

load

private void load(boolean old)
           throws java.lang.Exception
Throws:
java.lang.Exception

init

public void init(boolean reset)

resetToDefault

public final void resetToDefault()

getColor

public java.awt.Color getColor(java.lang.String colName,
                               java.awt.Color def)
Convenience method for accessing colour preferences.

Parameters:
colName - name of the colour
def - default value
Returns:
a Color object for the configured colour, or the default value if none configured.

getUIColor

public java.awt.Color getUIColor(java.lang.String colName)

getColorName

public java.lang.String getColorName(java.lang.String o)

getColor

public java.awt.Color getColor(Preferences.ColorKey key)

getColor

public java.awt.Color getColor(java.lang.String colName,
                               java.lang.String specName,
                               java.awt.Color def)
Convenience method for accessing colour preferences.

Parameters:
colName - name of the colour
specName - name of the special colour settings
def - default value
Returns:
a Color object for the configured colour, or the default value if none configured.

getDefaultColor

public java.awt.Color getDefaultColor(java.lang.String colKey)

putColor

public boolean putColor(java.lang.String colKey,
                        java.awt.Color val)

getInteger

public int getInteger(java.lang.String key,
                      int def)

getInteger

public int getInteger(java.lang.String key,
                      java.lang.String specName,
                      int def)

getLong

public long getLong(java.lang.String key,
                    long def)

getDouble

public double getDouble(java.lang.String key,
                        double def)

getDouble

public double getDouble(java.lang.String key,
                        java.lang.String def)

getCollection

public java.util.Collection<java.lang.String> getCollection(java.lang.String key,
                                                            java.util.Collection<java.lang.String> def)
Get a list of values for a certain key

Parameters:
key - the identifier for the setting
def - the default value.
Returns:
the corresponding value if the property has been set before, def otherwise

getCollection

public java.util.Collection<java.lang.String> getCollection(java.lang.String key)
Get a list of values for a certain key

Parameters:
key - the identifier for the setting
Returns:
the corresponding value if the property has been set before, an empty Collection otherwise.

getCollectionInternal

private java.util.List<java.lang.String> getCollectionInternal(java.lang.String key)

removeFromCollection

public void removeFromCollection(java.lang.String key,
                                 java.lang.String value)

putCollection

public boolean putCollection(java.lang.String key,
                             java.util.Collection<java.lang.String> value)

equalCollection

public static boolean equalCollection(java.util.Collection<java.lang.String> a,
                                      java.util.Collection<java.lang.String> b)

putCollectionBounded

public boolean putCollectionBounded(java.lang.String key,
                                    int maxsize,
                                    java.util.Collection<java.lang.String> val)
Saves at most maxsize items of collection val.


putCollectionDefault

private void putCollectionDefault(java.lang.String key,
                                  java.util.List<java.lang.String> val)

getArray

public java.util.Collection<java.util.Collection<java.lang.String>> getArray(java.lang.String key,
                                                                             java.util.Collection<java.util.Collection<java.lang.String>> def)
Used to read a 2-dimensional array of strings from the preference file. If not a single entry could be found, def is returned.


getArray

public java.util.Collection<java.util.Collection<java.lang.String>> getArray(java.lang.String key)

getArrayInternal

private java.util.List<java.util.List<java.lang.String>> getArrayInternal(java.lang.String key)

putArray

public boolean putArray(java.lang.String key,
                        java.util.Collection<java.util.Collection<java.lang.String>> value)

equalArray

public static boolean equalArray(java.util.Collection<java.util.Collection<java.lang.String>> a,
                                 java.util.Collection<java.util.List<java.lang.String>> b)

putArrayDefault

private void putArrayDefault(java.lang.String key,
                             java.util.List<java.util.List<java.lang.String>> val)

getListOfStructs

public java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> getListOfStructs(java.lang.String key,
                                                                                               java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> def)

getListOfStructsInternal

private java.util.List<java.util.Map<java.lang.String,java.lang.String>> getListOfStructsInternal(java.lang.String key)

putListOfStructs

public boolean putListOfStructs(java.lang.String key,
                                java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> value)

equalListOfStructs

public static boolean equalListOfStructs(java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> a,
                                         java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> b)

equalMap

private static boolean equalMap(java.util.Map<java.lang.String,java.lang.String> a,
                                java.util.Map<java.lang.String,java.lang.String> b)

putListOfStructsDefault

private void putListOfStructsDefault(java.lang.String key,
                                     java.util.List<java.util.Map<java.lang.String,java.lang.String>> val)

getListOfStructs

public <T> java.util.List<T> getListOfStructs(java.lang.String key,
                                              java.lang.Class<T> klass)
Get a list of hashes which are represented by a struct-like class. Possible properties are given by fields of the class klass that have the @pref annotation. Default constructor is used to initialize the struct objects, properties then override some of these default values.

Parameters:
key - main preference key
klass - The struct class
Returns:
a list of objects of type T or an empty list if nothing was found

getListOfStructs

public <T> java.util.List<T> getListOfStructs(java.lang.String key,
                                              java.util.Collection<T> def,
                                              java.lang.Class<T> klass)
same as above, but returns def if nothing was found


putListOfStructs

public <T> boolean putListOfStructs(java.lang.String key,
                                    java.util.Collection<T> val,
                                    java.lang.Class<T> klass)
Save a list of hashes represented by a struct-like class. Considers only fields that have the @pref annotation. In addition it does not write fields with null values. (Thus they are cleared) Default values are given by the field values after default constructor has been called. Fields equal to the default value are not written unless the field has the @writeExplicitly annotation.

Parameters:
key - main preference key
val - the list that is supposed to be saved
klass - The struct class
Returns:
true if something has changed

serializeListOfStructs

private <T> java.util.Collection<java.util.Map<java.lang.String,java.lang.String>> serializeListOfStructs(java.util.Collection<T> l,
                                                                                                          java.lang.Class<T> klass)

serializeStruct

public static <T> java.util.Map<java.lang.String,java.lang.String> serializeStruct(T struct,
                                                                                   java.lang.Class<T> klass)

deserializeStruct

public static <T> T deserializeStruct(java.util.Map<java.lang.String,java.lang.String> hash,
                                      java.lang.Class<T> klass)

putSetting

public boolean putSetting(java.lang.String key,
                          Preferences.Setting value)

getAllSettings

public java.util.Map<java.lang.String,Preferences.Setting> getAllSettings()

getAllDefaults

public java.util.Map<java.lang.String,Preferences.Setting> getAllDefaults()

updateSystemProperties

public void updateSystemProperties()
Updates system properties with the current values in the preferences.


updateSystemProperty

private void updateSystemProperty(java.lang.String key,
                                  java.lang.String value)

getPluginSites

public java.util.Collection<java.lang.String> getPluginSites()
Replies the collection of plugin site URLs from where plugin lists can be downloaded

Returns:

setPluginSites

public void setPluginSites(java.util.Collection<java.lang.String> sites)
Sets the collection of plugin site URLs.

Parameters:
sites - the site URLs

validateXML

public void validateXML(java.io.Reader in)
                 throws java.lang.Exception
Throws:
java.lang.Exception

fromXML

public void fromXML(java.io.Reader in)
             throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

parse

public void parse()
           throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

parseRoot

public void parseRoot()
               throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

jumpToEnd

private void jumpToEnd()
                throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

parseToplevelList

protected void parseToplevelList()
                          throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

parseInnerList

protected java.util.List<java.lang.String> parseInnerList()
                                                   throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

parseMap

protected java.util.Map<java.lang.String,java.lang.String> parseMap()
                                                             throws javax.xml.stream.XMLStreamException
Throws:
javax.xml.stream.XMLStreamException

throwException

protected void throwException(java.lang.String msg)

toXML

public java.lang.String toXML(boolean nopass)

removeObsolete

public void removeObsolete()
Removes obsolete preference settings. If you throw out a once-used preference setting, add it to the list here with an expiry date (written as comment). If you see something with an expiry date in the past, remove it from the list.


isEqual

public static boolean isEqual(Preferences.Setting a,
                              Preferences.Setting b)


JOSM