public class PreferencesConnector extends AbstractPropertyConnector
Preferences
feature of Java.
Locations:
Modifier | Constructor and Description |
---|---|
|
PreferencesConnector()
Default Constructor initialize the User and System
Preferences . |
protected |
PreferencesConnector(Preferences systemPrefs,
Preferences userPrefs) |
Modifier and Type | Method and Description |
---|---|
protected String |
getPreferenceValue(String path,
String key,
Preferences preferences)
Resolve the given path and key against the given Preferences.
|
String |
getString(String keyPath)
return a String-Value for the given key.
|
protected void |
setPreferenceValue(String path,
String key,
String value,
Preferences preferences)
Resolve the given path and key against the given Preferences.
|
void |
setString(String keyPath,
String value)
Stores the given Value into the User-Preferences.
|
void |
setSystemString(String keyPath,
String value)
Stores the given Value into the System-Preferences.
|
getContent, getObject
addConnector, getConnectors, getContentResolver, getName, getObjectResolver, init, setContentResolver, setName, setObjectResolver
public PreferencesConnector()
Preferences
.protected PreferencesConnector(Preferences systemPrefs, Preferences userPrefs)
systemPrefs
- Preferences.systemRoot()
userPrefs
- Preferences.userRoot()
public String getString(String keyPath)
Connector
keyPath
- the Key for the configuration-property. e.g.: "com/mycompany/myapp/myParameterKey"protected String getPreferenceValue(String path, String key, Preferences preferences)
path
- the preferences path (placeholder part before '/')key
- the preferences key (placeholder part after '/')preferences
- the Preferences to resolve againstnull
if none foundpublic void setString(String keyPath, String value)
keyPath
- - The full KeyPathvalue
- - The new Valuepublic void setSystemString(String keyPath, String value)
keyPath
- - The full KeyPathvalue
- - The new Valueprotected void setPreferenceValue(String path, String key, String value, Preferences preferences)
path
- the preferences path (placeholder part before '/')key
- the preferences key (placeholder part after '/')value
- the Value to store.preferences
- the Preferences to resolve againstCopyright © 2008–2016 Brabenetz Harald, Austria. All rights reserved.