public interface Preferences
Dictionary
.
Preferences are configuration properties for a particular user of the application.
Like Properties Preferences have a name and a value, which can be any
Object
.
The current specification differs from other Preferences like the
Java Preferences
or the OSGI's
by the following:
This Preferences do not impose implicit categorization like the
Java package in case of Java Preferences resp. the Bundle's name for the OSGI
Preferences.
As benefit of this behavior, Preferences can be organized according
their inherent structure rather than than the structure of source code.
PreferencesService
Modifier and Type | Method and Description |
---|---|
void |
flush()
Deprecated.
This method persists all changes made to this instance.
|
java.lang.String |
get(java.lang.String relativePath)
Deprecated.
Shortcut access to a String Preference.
|
<Type> Type |
get(java.lang.String relativePath,
Type defaultValue)
Deprecated.
Access a Preference value at a given Path and type given by means of the
default value.
|
<Type> Type |
get(java.lang.String relativePath,
Type defaultValue,
java.lang.Class<Type> type)
Deprecated.
|
java.lang.String |
getAuthorizableId()
Deprecated.
|
java.util.Collection<Preferences> |
getChildren()
Deprecated.
All direct children Preferences.
|
java.lang.String |
getPath()
Deprecated.
|
java.lang.String |
getPreferenceName()
Deprecated.
Access the relative Path of the current Preferences within the hierarchy.
|
Preferences |
getPreferences(java.lang.String relativePath)
Deprecated.
Return Preferences contained with in this Preferences at the given relative
Path.
A null Preference is not allowed as return value. |
java.util.Collection<java.lang.String> |
getPreferencesNames()
Deprecated.
The names of all Preferences which contain a value.
|
void |
put(java.lang.String relativePath,
java.lang.Object value)
Deprecated.
Store the given value at the given path.
|
void |
refresh()
Deprecated.
A call to this method synchronizes the values of this Preferences with its
persistent state.
|
void |
remove(java.lang.String relativePath)
Deprecated.
Remove the value at the given path.
|
java.lang.String getPath()
java.lang.String getAuthorizableId()
PreferencesService.get(String)
java.lang.String getPreferenceName()
String path = "a/b"; Preferences rootPref = preferencesService.get(session) rootPref.getPreferences(path).getPath().equals(path)
java.util.Collection<java.lang.String> getPreferencesNames()
java.util.Collection<Preferences> getChildren()
Preferences getPreferences(java.lang.String relativePath) throws PathNotFoundException
null
Preference is not allowed as return value.
If there are no Preferences at the given Path, implementations
have to create new empty Preferences or throw a
PathNotFoundException
, if this
is not possible.relativePath
- relative relativePath within the current Preferences.PathNotFoundException
- if the Path is absolute or not contained
within this Preferences. If path points to a Preferences value
other than of type Preferences.
A denied access to Preferences has to result in a PathNotFoundExceptionjava.lang.String get(java.lang.String relativePath) throws PathNotFoundException
relativePath
- of the PreferencePathNotFoundException
- if the path does not exist, does not point to
Preferences-value that may be converted to a String, or
access restrictions prevent from accessing the value.get(String, Object)
<Type> Type get(java.lang.String relativePath, Type defaultValue) throws PathNotFoundException
relativePath
- path to PreferencedefaultValue
- value to take return type or
value if none exists at the given pathnone-null
value of given TypePathNotFoundException
- if path is not accessible for any reason<Type> Type get(java.lang.String relativePath, Type defaultValue, java.lang.Class<Type> type) throws PathNotFoundException
relativePath
- path to preferencedefaultValue
- to take if none is contained in the current preferencestype
- the value has to be returnedPathNotFoundException
- in any case the path can not be accessedvoid put(java.lang.String relativePath, java.lang.Object value) throws AccessDeniedException
relativePath
- path to store the given value atvalue
- to storeAccessDeniedException
- if access restrictions prevent from saving the valueflush()
void remove(java.lang.String relativePath) throws AccessDeniedException
relativePath
- to the preference to removeAccessDeniedException
- if access restrictions prevent from removing a Preferenceflush()
void refresh()
flush()
void flush() throws AccessDeniedException
AccessDeniedException
- in case access restrictions prevent from
writing to persistence layer.Copyright © 2010 - 2020 Adobe. All Rights Reserved