public class EclipsePreferences extends java.lang.Object implements IEclipsePreferences, IScope
IEclipsePreferences.INodeChangeListener, IEclipsePreferences.IPreferenceChangeListener, IEclipsePreferences.NodeChangeEvent, IEclipsePreferences.PreferenceChangeEvent| Modifier and Type | Field and Description |
|---|---|
protected java.util.Map<java.lang.String,java.lang.Object> |
children |
static boolean |
DEBUG_PREFERENCE_GENERAL |
static boolean |
DEBUG_PREFERENCE_GET |
static boolean |
DEBUG_PREFERENCE_SET |
protected static java.lang.String |
debugPluginName |
static java.lang.String |
DEFAULT_PREFERENCES_DIRNAME |
protected boolean |
dirty |
protected static java.lang.String |
DOUBLE_SLASH |
protected static IEclipsePreferences[] |
EMPTY_NODE_ARRAY |
protected static java.lang.String |
EMPTY_STRING |
protected static java.lang.String[] |
EMPTY_STRING_ARRAY |
protected boolean |
loading |
protected java.lang.String |
name |
protected EclipsePreferences |
parent |
protected static java.lang.String |
PATH_SEPARATOR |
static java.lang.String |
PREFS_FILE_EXTENSION |
protected ImmutableMap |
properties |
protected boolean |
removed |
protected static java.lang.String |
VERSION_KEY |
protected static java.lang.String |
VERSION_VALUE |
| Modifier | Constructor and Description |
|---|---|
|
EclipsePreferences() |
protected |
EclipsePreferences(EclipsePreferences parent,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
absolutePath()
Returns this node's absolute path name.
|
void |
accept(IPreferenceNodeVisitor visitor)
Accepts the given visitor.
|
protected IEclipsePreferences |
addChild(java.lang.String childName,
IEclipsePreferences child) |
void |
addNodeChangeListener(IEclipsePreferences.INodeChangeListener listener)
Register the given listener for changes to this node.
|
void |
addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener listener)
Register the given listener for notification of preference changes to this node.
|
protected void |
checkRemoved() |
protected boolean |
childExists(java.lang.String childName) |
java.lang.String[] |
childrenNames()
Returns the names of the children of this node.
|
void |
clear()
Removes all of the properties (key-value associations) in this node.
|
protected java.lang.String[] |
computeChildren(IPath root) |
protected IPath |
computeLocation(IPath root,
java.lang.String qualifier) |
protected static void |
convertFromProperties(EclipsePreferences node,
java.util.Properties table,
boolean notify) |
protected java.util.Properties |
convertToProperties(java.util.Properties result,
java.lang.String prefix) |
IEclipsePreferences |
create(EclipsePreferences nodeParent,
java.lang.String nodeName,
java.lang.Object context) |
IEclipsePreferences |
create(IEclipsePreferences nodeParent,
java.lang.String nodeName)
Create and return a new preference node with the given parent and name.
|
static java.lang.String[] |
decodePath(java.lang.String fullPath) |
static java.lang.String |
encodePath(java.lang.String path,
java.lang.String key) |
protected void |
fireNodeEvent(IEclipsePreferences.NodeChangeEvent event,
boolean added) |
protected void |
firePreferenceEvent(java.lang.String key,
java.lang.Object oldValue,
java.lang.Object newValue) |
void |
flush()
Forces any changes in the contents of this node and its descendants to
the persistent store.
|
java.lang.String |
get(java.lang.String key,
java.lang.String defaultValue)
Returns the value associated with the specified
key in this
node. |
boolean |
getBoolean(java.lang.String key,
boolean defaultValue)
Returns the
boolean value represented by the String
object associated with the specified key in this node. |
byte[] |
getByteArray(java.lang.String key,
byte[] defaultValue)
Returns the
byte[] value represented by the String
object associated with the specified key in this node. |
protected IEclipsePreferences |
getChild(java.lang.String key,
java.lang.Object context,
boolean create)
Thread safe way to obtain a child for a given key.
|
protected IEclipsePreferences[] |
getChildren(boolean create)
Thread safe way to obtain all children of this node.
|
double |
getDouble(java.lang.String key,
double defaultValue)
Returns the
double value represented by the String
object associated with the specified key in this node. |
float |
getFloat(java.lang.String key,
float defaultValue)
Returns the float
value represented by the String
object associated with the specified key in this node. |
int |
getInt(java.lang.String key,
int defaultValue)
Returns the
int value represented by the String
object associated with the specified key in this node. |
protected IEclipsePreferences |
getLoadLevel() |
protected IPath |
getLocation() |
long |
getLong(java.lang.String key,
long defaultValue)
Returns the
long value represented by the String
object associated with the specified key in this node. |
static java.lang.String |
getSegment(java.lang.String path,
int segment) |
static int |
getSegmentCount(java.lang.String path) |
protected java.lang.String[] |
internalChildNames() |
protected EclipsePreferences |
internalCreate(EclipsePreferences nodeParent,
java.lang.String nodeName,
java.lang.Object context) |
protected IEclipsePreferences |
internalFlush() |
protected java.lang.String |
internalGet(java.lang.String key)
Returns the existing value at the given key, or null if
no such value exists.
|
protected IEclipsePreferences |
internalNode(java.lang.String path,
boolean notify,
java.lang.Object context)
Implements the node(String) method, and optionally notifies listeners.
|
protected java.lang.String |
internalPut(java.lang.String key,
java.lang.String newValue)
Stores the given (key,value) pair, performing lazy initialization of the
properties field if necessary.
|
protected boolean |
isAlreadyLoaded(IEclipsePreferences node) |
boolean |
isDirty() |
protected boolean |
isLoading() |
java.lang.String[] |
keys()
Returns all of the keys that have an associated value in this node.
|
protected void |
load()
Loads the preference node.
|
protected void |
load(IPath location) |
protected void |
loaded() |
protected void |
loadLegacy() |
protected static java.util.Properties |
loadProperties(IPath location) |
static void |
log(IStatus status) |
protected void |
makeDirty() |
static java.lang.String |
makeRelative(java.lang.String path) |
java.lang.String |
name()
Returns this node's name, relative to its parent.
|
Preferences |
node(java.lang.String pathName)
Return the preferences node with the given path.
|
boolean |
nodeExists(java.lang.String path)
Returns true if the named node exists.
|
Preferences |
parent()
Returns the parent of this node, or
null if this is the root. |
void |
put(java.lang.String key,
java.lang.String newValue)
Associates the specified value with the specified key in this node.
|
void |
putBoolean(java.lang.String key,
boolean value)
Associates a
String object representing the specified
boolean value with the specified key in this node. |
void |
putByteArray(java.lang.String key,
byte[] value)
Associates a
String object representing the specified
byte[] with the specified key in this node. |
void |
putDouble(java.lang.String key,
double value)
Associates a
String object representing the specified
double value with the specified key in this node. |
void |
putFloat(java.lang.String key,
float value)
Associates a
String object representing the specified
float value with the specified key in this node. |
void |
putInt(java.lang.String key,
int value)
Associates a
String object representing the specified
int value with the specified key in this node. |
void |
putLong(java.lang.String key,
long value)
Associates a
String object representing the specified
long value with the specified key in this node. |
void |
remove(java.lang.String key)
Removes the value associated with the specified
key in this
node, if any. |
void |
removeNode()
Remove this node from the preference hierarchy.
|
protected void |
removeNode(IEclipsePreferences child) |
protected java.lang.Object |
removeNode(java.lang.String key) |
void |
removeNodeChangeListener(IEclipsePreferences.INodeChangeListener listener)
De-register the given listener from receiving event change notifications
for this node.
|
void |
removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener listener)
De-register the given listener from receiving notification of preference changes
to this node.
|
protected static java.lang.String |
removeTimestampFromTable(java.util.Properties properties) |
protected void |
save()
Saves the preference node.
|
protected void |
save(IPath location) |
protected void |
setLoading(boolean isLoading) |
void |
shareStrings(StringPool pool)
Traverses the preference hierarchy rooted at this node, and adds
all preference key and value strings to the provided pool.
|
void |
sync()
Ensures that future reads from this node and its descendants reflect any
changes that were committed to the persistent store (from any VM) prior
to the
sync invocation. |
java.lang.String |
toDeepDebugString() |
java.lang.String |
toString() |
protected static void |
write(java.util.Properties properties,
IPath location) |
public static final java.lang.String DEFAULT_PREFERENCES_DIRNAME
public static final java.lang.String PREFS_FILE_EXTENSION
protected static final IEclipsePreferences[] EMPTY_NODE_ARRAY
protected static final java.lang.String[] EMPTY_STRING_ARRAY
protected static final java.lang.String VERSION_KEY
protected static final java.lang.String VERSION_VALUE
protected static final java.lang.String PATH_SEPARATOR
protected static final java.lang.String DOUBLE_SLASH
protected static final java.lang.String EMPTY_STRING
protected ImmutableMap properties
protected java.util.Map<java.lang.String,java.lang.Object> children
protected boolean dirty
protected boolean loading
protected final java.lang.String name
protected final EclipsePreferences parent
protected boolean removed
public static boolean DEBUG_PREFERENCE_GENERAL
public static boolean DEBUG_PREFERENCE_SET
public static boolean DEBUG_PREFERENCE_GET
protected static final java.lang.String debugPluginName
public EclipsePreferences()
protected EclipsePreferences(EclipsePreferences parent, java.lang.String name)
public java.lang.String absolutePath()
Preferences"/".
'/').
"." and ".." have no
special significance in path names.
absolutePath in interface Preferencespublic void accept(IPreferenceNodeVisitor visitor) throws BackingStoreException
IEclipsePreferencesvisit method
is called with this node. If the visitor returns true,
this method visits this node's children.accept in interface IEclipsePreferencesvisitor - the visitorBackingStoreExceptionIPreferenceNodeVisitor.visit(IEclipsePreferences)protected IEclipsePreferences addChild(java.lang.String childName, IEclipsePreferences child)
public void addNodeChangeListener(IEclipsePreferences.INodeChangeListener listener)
IEclipsePreferencesnull.addNodeChangeListener in interface IEclipsePreferenceslistener - the node change listener to addIEclipsePreferences.removeNodeChangeListener(IEclipsePreferences.INodeChangeListener),
IEclipsePreferences.INodeChangeListenerpublic void addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener listener)
IEclipsePreferencesnull.addPreferenceChangeListener in interface IEclipsePreferenceslistener - the preference change listener to registerIEclipsePreferences.removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener),
IEclipsePreferences.IPreferenceChangeListenerprotected void checkRemoved()
public java.lang.String[] childrenNames()
throws BackingStoreException
Preferencesnull!)childrenNames in interface PreferencesBackingStoreException - if this operation cannot be completed due
to a failure in the backing store, or inability to communicate
with it.protected java.lang.String[] internalChildNames()
public void clear()
Preferencesclear in interface PreferencesPreferences.remove(String)protected java.lang.String[] computeChildren(IPath root)
protected IPath computeLocation(IPath root,
java.lang.String qualifier)
protected static void convertFromProperties(EclipsePreferences node, java.util.Properties table, boolean notify)
protected static void write(java.util.Properties properties,
IPath location)
throws BackingStoreException
BackingStoreExceptionprotected static java.lang.String removeTimestampFromTable(java.util.Properties properties)
throws java.io.IOException
java.io.IOExceptionprotected java.util.Properties convertToProperties(java.util.Properties result,
java.lang.String prefix)
throws BackingStoreException
BackingStoreExceptionpublic IEclipsePreferences create(IEclipsePreferences nodeParent, java.lang.String nodeName)
IScopenull. Clients are able to create a new node
in memory or load the node's contents from the backing store. Neither the
parent or name arguments should be null.
Implementors should note that the node might not have been added to the child list of the parent yet, and therefore might not be able to be referenced through navigation from the root node.
protected boolean isLoading()
protected void setLoading(boolean isLoading)
public IEclipsePreferences create(EclipsePreferences nodeParent, java.lang.String nodeName, java.lang.Object context)
public void flush()
throws BackingStoreException
PreferencesOnce this method returns successfully, it is safe to assume that all changes made in the subtree rooted at this node prior to the method invocation have become permanent.
Implementations are free to flush changes into the persistent store at any time. They do not need to wait for this method to be called.
When a flush occurs on a newly created node, it is made persistent, as are any ancestors (and descendants) that have yet to be made persistent. Note however that any properties value changes in ancestors are not guaranteed to be made persistent.
flush in interface PreferencesBackingStoreException - if this operation cannot be completed due
to a failure in the backing store, or inability to communicate
with it.Preferences.sync()protected IEclipsePreferences internalFlush() throws BackingStoreException
BackingStoreExceptionpublic java.lang.String get(java.lang.String key,
java.lang.String defaultValue)
Preferenceskey in this
node. Returns the specified default if there is no value associated with
the key, or the backing store is inaccessible.get in interface Preferenceskey - key whose associated value is to be returned.defaultValue - the value to be returned in the event that this node has no
value associated with key or the backing store is
inaccessible.key, or def if
no value is associated with key.public boolean getBoolean(java.lang.String key,
boolean defaultValue)
Preferencesboolean value represented by the String
object associated with the specified key in this node. Valid
strings are "true", which represents true, and "false", which
represents false. Case is ignored, so, for example, "TRUE"
and "False" are also valid. This method is intended for use in
conjunction with the Preferences.putBoolean(java.lang.String, boolean) method.
Returns the specified default if there is no value associated with the
key, the backing store is inaccessible, or if the associated
value is something other than "true" or "false", ignoring case.
getBoolean in interface Preferenceskey - key whose associated value is to be returned as a
boolean.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as a boolean or the backing store
is inaccessible.boolean value represented by the String
object associated with key in this node, or
null if the associated value does not exist or cannot
be interpreted as a boolean.Preferences.get(String,String),
Preferences.putBoolean(String,boolean)public byte[] getByteArray(java.lang.String key,
byte[] defaultValue)
Preferencesbyte[] value represented by the String
object associated with the specified key in this node. Valid
String objects are Base64 encoded binary data, as
defined in RFC 2045 ,
Section 6.8, with one minor change: the string must consist solely of
characters from the Base64 Alphabet ; no newline characters or
extraneous characters are permitted. This method is intended for use in
conjunction with the Preferences.putByteArray(java.lang.String, byte[]) method.
Returns the specified default if there is no value associated with the
key, the backing store is inaccessible, or if the associated
value is not a valid Base64 encoded byte array (as defined above).
getByteArray in interface Preferenceskey - key whose associated value is to be returned as a
byte[] object.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as a byte[] type, or the backing
store is inaccessible.byte[] value represented by the String
object associated with key in this node, or
def if the associated value does not exist or cannot
be interpreted as a byte[].Preferences.get(String,String),
Preferences.putByteArray(String,byte[])protected boolean childExists(java.lang.String childName)
protected IEclipsePreferences getChild(java.lang.String key, java.lang.Object context, boolean create)
protected IEclipsePreferences[] getChildren(boolean create)
public double getDouble(java.lang.String key,
double defaultValue)
Preferencesdouble value represented by the String
object associated with the specified key in this node. The
String object is converted to a double value as by
Double.parseDouble(String). Returns the specified default if
there is no value associated with the key, the backing store
is inaccessible, or if Double.parseDouble(String) would throw
a NumberFormatException if the associated value were passed.
This method is intended for use in conjunction with the
Preferences.putDouble(java.lang.String, double) method.getDouble in interface Preferenceskey - key whose associated value is to be returned as a
double value.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as a double type or the backing
store is inaccessible.double value represented by the String
object associated with key in this node, or
def if the associated value does not exist or cannot
be interpreted as a double type.Preferences.putDouble(String,double),
Preferences.get(String,String)public float getFloat(java.lang.String key,
float defaultValue)
Preferencesvalue represented by the String
object associated with the specified key in this node. The
String object is converted to a float value as by
Float.parseFloat(String). Returns the specified default if
there is no value associated with the key, the backing store
is inaccessible, or if Float.parseFloat(String) would throw a
NumberFormatException if the associated value were passed.
This method is intended for use in conjunction with the Preferences.putFloat(java.lang.String, float)
method.getFloat in interface Preferenceskey - key whose associated value is to be returned as a
float value.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as a float type or the backing
store is inaccessible.float value represented by the string associated
with key in this node, or def if the
associated value does not exist or cannot be interpreted as a
float type.Preferences.putFloat(String,float),
Preferences.get(String,String)public int getInt(java.lang.String key,
int defaultValue)
Preferencesint value represented by the String
object associated with the specified key in this node. The
String object is converted to an int as by
Integer.parseInt(String). Returns the specified default if
there is no value associated with the key, the backing store
is inaccessible, or if Integer.parseInt(String) would throw a
NumberFormatException if the associated value were
passed. This method is intended for use in conjunction with the
Preferences.putInt(java.lang.String, int) method.getInt in interface Preferenceskey - key whose associated value is to be returned as an
int.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as an int or the backing store is
inaccessible.int value represented by the String
object associated with key in this node, or
def if the associated value does not exist or cannot
be interpreted as an int type.Preferences.putInt(String,int),
Preferences.get(String,String)protected IEclipsePreferences getLoadLevel()
protected IPath getLocation()
public long getLong(java.lang.String key,
long defaultValue)
Preferenceslong value represented by the String
object associated with the specified key in this node. The
String object is converted to a long as by
Long.parseLong(String). Returns the specified default if
there is no value associated with the key, the backing store
is inaccessible, or if Long.parseLong(String) would throw a
NumberFormatException if the associated value were
passed. This method is intended for use in conjunction with the
Preferences.putLong(java.lang.String, long) method.getLong in interface Preferenceskey - key whose associated value is to be returned as a
long value.defaultValue - the value to be returned in the event that this node has no
value associated with key or the associated value
cannot be interpreted as a long type or the backing
store is inaccessible.long value represented by the String
object associated with key in this node, or
def if the associated value does not exist or cannot
be interpreted as a long type.Preferences.putLong(String,long),
Preferences.get(String,String)protected EclipsePreferences internalCreate(EclipsePreferences nodeParent, java.lang.String nodeName, java.lang.Object context)
protected java.lang.String internalGet(java.lang.String key)
protected IEclipsePreferences internalNode(java.lang.String path, boolean notify, java.lang.Object context)
protected java.lang.String internalPut(java.lang.String key,
java.lang.String newValue)
protected boolean isAlreadyLoaded(IEclipsePreferences node)
public java.lang.String[] keys()
Preferencesnull!)keys in interface Preferencesprotected void load()
throws BackingStoreException
BackingStoreException - if the node exists in the backing store but it
could not be loadedprotected static java.util.Properties loadProperties(IPath location)
throws BackingStoreException
BackingStoreExceptionprotected void load(IPath location)
throws BackingStoreException
BackingStoreExceptionprotected void loaded()
protected void loadLegacy()
public static void log(IStatus status)
protected void makeDirty()
public boolean isDirty()
public java.lang.String name()
Preferencesname in interface Preferencespublic Preferences node(java.lang.String pathName)
IEclipsePreferencesnull.
See the spec of Preferences.node(String) for more details.
Note that if the node does not yet exist and is created, then the appropriate
IEclipsePreferences.NodeChangeEvent must be sent to listeners who are
registered at this node.
node in interface IEclipsePreferencesnode in interface PreferencespathName - the path of the nodePreferences.node(String),
IEclipsePreferences.NodeChangeEventprotected void fireNodeEvent(IEclipsePreferences.NodeChangeEvent event, boolean added)
public boolean nodeExists(java.lang.String path)
throws BackingStoreException
Preferences'/') are
interpreted relative to the root of this node. Relative pathnames (which
begin with any character other than '/') are interpreted
relative to this node itself. The pathname "" is valid, and
refers to this node itself.
If this node (or an ancestor) has already been removed with the
Preferences.removeNode() method, it is legal to invoke this method,
but only with the pathname ""; the invocation will return
false. Thus, the idiom p.nodeExists("") may be
used to test whether p has been removed.
nodeExists in interface Preferencespath - the path name of the node whose existence is to be
checked.BackingStoreException - if this operation cannot be completed due
to a failure in the backing store, or inability to communicate
with it.public Preferences parent()
Preferencesnull if this is the root.parent in interface Preferencesprotected void firePreferenceEvent(java.lang.String key,
java.lang.Object oldValue,
java.lang.Object newValue)
public void put(java.lang.String key,
java.lang.String newValue)
Preferencesput in interface Preferenceskey - key with which the specified value is to be associated.newValue - value to be associated with the specified key.public void putBoolean(java.lang.String key,
boolean value)
PreferencesString object representing the specified
boolean value with the specified key in this node. The
associated string is "true" if the value is true, and "false"
if it is false. This method is intended for use in
conjunction with the Preferences.getBoolean(java.lang.String, boolean) method.
Implementor's note: it is not necessary that the value be
represented by a string in the backing store. If the backing store
supports boolean values, it is not unreasonable to use them.
This implementation detail is not visible through the Preferences
API, which allows the value to be read as a boolean
(with getBoolean) or a String (with get)
type.
putBoolean in interface Preferenceskey - key with which the string form of value is to be
associated.value - value whose string form is to be associated with
key.Preferences.getBoolean(String,boolean),
Preferences.get(String,String)public void putByteArray(java.lang.String key,
byte[] value)
PreferencesString object representing the specified
byte[] with the specified key in this node. The
associated String object the Base64 encoding of the
byte[], as defined in RFC 2045 , Section 6.8,
with one minor change: the string will consist solely of characters from
the Base64 Alphabet ; it will not contain any newline characters.
This method is intended for use in conjunction with the
Preferences.getByteArray(java.lang.String, byte[]) method.
Implementor's note: it is not necessary that the value be
represented by a String type in the backing store. If the
backing store supports byte[] values, it is not unreasonable
to use them. This implementation detail is not visible through the Preferences API, which allows the value to be read as an a
byte[] object (with getByteArray) or a
String object (with get).
putByteArray in interface Preferenceskey - key with which the string form of value
is to be associated.value - value whose string form is to be associated with
key.Preferences.getByteArray(String,byte[]),
Preferences.get(String,String)public void putDouble(java.lang.String key,
double value)
PreferencesString object representing the specified
double value with the specified key in this node.
The associated String object is the one that would be returned
if the double value were passed to
Double.toString(double). This method is intended for use in
conjunction with the Preferences.getDouble(java.lang.String, double) method
Implementor's note: it is not necessary that the value be
represented by a string in the backing store. If the backing store
supports double values, it is not unreasonable to use them.
This implementation detail is not visible through the Preferences
API, which allows the value to be read as a double (with
getDouble) or a String (with get)
type.
putDouble in interface Preferenceskey - key with which the string form of value is to be
associated.value - value whose string form is to be associated with
key.Preferences.getDouble(String,double)public void putFloat(java.lang.String key,
float value)
PreferencesString object representing the specified
float value with the specified key in this node.
The associated String object is the one that would be returned
if the float value were passed to
Float.toString(float). This method is intended for use in
conjunction with the Preferences.getFloat(java.lang.String, float) method.
Implementor's note: it is not necessary that the value be
represented by a string in the backing store. If the backing store
supports float values, it is not unreasonable to use them.
This implementation detail is not visible through the Preferences
API, which allows the value to be read as a float (with
getFloat) or a String (with get) type.
putFloat in interface Preferenceskey - key with which the string form of value is to be
associated.value - value whose string form is to be associated with
key.Preferences.getFloat(String,float)public void putInt(java.lang.String key,
int value)
PreferencesString object representing the specified
int value with the specified key in this node. The
associated string is the one that would be returned if the int
value were passed to Integer.toString(int). This method is
intended for use in conjunction with Preferences.getInt(java.lang.String, int) method.
Implementor's note: it is not necessary that the property value
be represented by a String object in the backing store. If the
backing store supports integer values, it is not unreasonable to use
them. This implementation detail is not visible through the
Preferences API, which allows the value to be read as an
int (with getInt or a String (with
get) type.
putInt in interface Preferenceskey - key with which the string form of value is to be associated.value - value whose string form is to be associated with
key.Preferences.getInt(String,int)public void putLong(java.lang.String key,
long value)
PreferencesString object representing the specified
long value with the specified key in this node. The
associated String object is the one that would be returned if
the long value were passed to Long.toString(long).
This method is intended for use in conjunction with the Preferences.getLong(java.lang.String, long)
method.
Implementor's note: it is not necessary that the value
be represented by a String type in the backing store. If the
backing store supports long values, it is not unreasonable to
use them. This implementation detail is not visible through the Preferences API, which allows the value to be read as a
long (with getLong or a String (with
get) type.
putLong in interface Preferenceskey - key with which the string form of value
is to be associated.value - value whose string form is to be associated with
key.Preferences.getLong(String,long)public void remove(java.lang.String key)
Preferenceskey in this
node, if any.remove in interface Preferenceskey - key whose mapping is to be removed from this node.Preferences.get(String,String)public void removeNode()
throws BackingStoreException
IEclipsePreferences
Functionally equivalent to calling Preferences.removeNode().
See the spec of Preferences.removeNode() for more details.
Implementors must send the appropriate IEclipsePreferences.NodeChangeEvent
to listeners who are registered on this node's parent.
When this node is removed, its associated preference and node change listeners should be removed as well.
removeNode in interface IEclipsePreferencesremoveNode in interface PreferencesBackingStoreException - if there was a problem removing this nodePreferences.removeNode(),
IEclipsePreferences.NodeChangeEventprotected void removeNode(IEclipsePreferences child)
protected java.lang.Object removeNode(java.lang.String key)
public void removeNodeChangeListener(IEclipsePreferences.INodeChangeListener listener)
IEclipsePreferencesnull.removeNodeChangeListener in interface IEclipsePreferenceslistener - the node change listener to removeIEclipsePreferences.addNodeChangeListener(IEclipsePreferences.INodeChangeListener),
IEclipsePreferences.INodeChangeListenerpublic void removePreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener listener)
IEclipsePreferencesnull.removePreferenceChangeListener in interface IEclipsePreferenceslistener - the preference change listener to removeIEclipsePreferences.addPreferenceChangeListener(IEclipsePreferences.IPreferenceChangeListener),
IEclipsePreferences.IPreferenceChangeListenerprotected void save()
throws BackingStoreException
BackingStoreException - if the node exists in the backing store but it
could not be savedprotected void save(IPath location)
throws BackingStoreException
BackingStoreExceptionpublic void shareStrings(StringPool pool)
pool - The pool to share strings inpublic static java.lang.String encodePath(java.lang.String path,
java.lang.String key)
public static java.lang.String getSegment(java.lang.String path,
int segment)
public static int getSegmentCount(java.lang.String path)
public static java.lang.String makeRelative(java.lang.String path)
public static java.lang.String[] decodePath(java.lang.String fullPath)
public void sync()
throws BackingStoreException
Preferencessync invocation. As a side-effect, forces any changes
in the contents of this node and its descendants to the persistent store,
as if the flush method had been invoked on this node.sync in interface PreferencesBackingStoreException - if this operation cannot be completed due
to a failure in the backing store, or inability to communicate
with it.Preferences.flush()public java.lang.String toDeepDebugString()
public java.lang.String toString()
toString in class java.lang.Object