|
Eclipse Platform Release 4.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.core.runtime.preferences.AbstractPreferenceStorage
public abstract class AbstractPreferenceStorage
Abstract class which can be used to help provide an alternate storage mechanism for Eclipse preferences. Clients can over-ride this class and implement the appropriate methods to read/persist preferences.
Constructor Summary | |
---|---|
AbstractPreferenceStorage()
|
Method Summary | |
---|---|
abstract String[] |
childrenNames(String nodePath)
Return a string array containing the names of the children for the node with the given path. |
abstract Properties |
load(String nodePath)
Return a java.util.Properties object containing the preference
key/value pairs for the preference node with the specified path, and its children. |
protected Properties |
loadProperties(InputStream input)
Helper method to load a java.util.Properties file from the given
input stream. |
abstract void |
removed(String nodePath)
Callback to inform the client that the preference node with the specified path has been deleted and the client should react accordingly and make the appropriate changes to the storage. |
abstract void |
save(String nodePath,
Properties properties)
Save the given java.util.Properties object which represents
preference key/value pairs for the preference node represented by the given
path. |
protected void |
saveProperties(OutputStream output,
Properties properties)
Helper method to save the given java.util.Properties object
to the given output stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AbstractPreferenceStorage()
Method Detail |
---|
public abstract Properties load(String nodePath) throws BackingStoreException
java.util.Properties
object containing the preference
key/value pairs for the preference node with the specified path, and its children.
The table keys consist of an optional child node path and separator, followed by the property key. The table values are the values of the properties.
[childNodePath/]propertyKey=propertyValue
Note: Whether they are absolute or relative, the paths in the returned Properties object are always interpreted as relative to the node specified by nodePath.
nodePath
- the absolute path of the preference node
java.util.Properties
object or null
BackingStoreException
- if there was a problem loading the propertiespublic abstract void save(String nodePath, Properties properties) throws BackingStoreException
java.util.Properties
object which represents
preference key/value pairs for the preference node represented by the given
path.
Clients are reminded that if the given properties object is empty then the preference node has been removed and they should react accordingly (e.g. for instance by removing the file on disk)
nodePath
- the absolute path of the preference nodeproperties
- the java.util.Properties
object to store
BackingStoreException
- if there was a problem saving the propertiesprotected Properties loadProperties(InputStream input) throws BackingStoreException
java.util.Properties
file from the given
input stream. The stream will be closed on completion of the operation.
input
- the stream to load from
java.util.Properties
object loaded from the stream
BackingStoreException
- if there was a problem loading the fileprotected void saveProperties(OutputStream output, Properties properties) throws BackingStoreException
java.util.Properties
object
to the given output stream. The stream will be closed at the end of the operation.
output
- the stream to store the object toproperties
- the object to store
BackingStoreException
- if there was a problem saving the objectpublic abstract String[] childrenNames(String nodePath) throws BackingStoreException
nodePath
- the path for the preference node
BackingStoreException
- if there was a problem retrieving the child namespublic abstract void removed(String nodePath)
nodePath
- the absolute path of the preference node
|
Eclipse Platform Release 4.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Guidelines for using Eclipse APIs.
Copyright (c) Eclipse contributors and others 2000, 2012. All rights reserved.