|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ocd.prefs.util.Preferences | +--org.ocd.prefs.util.AbstractPreferences | +--org.ocd.prefs.file.FilePreferences
Field Summary | |
static java.lang.String |
PROPERTIES_FILE
|
Fields inherited from class org.ocd.prefs.util.AbstractPreferences |
lock, newNode |
Fields inherited from class org.ocd.prefs.util.Preferences |
MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH |
Constructor Summary | |
FilePreferences(java.io.File pPrefDir)
Creates new FilePreferences |
|
FilePreferences(FilePreferences parent,
java.lang.String name)
Creates new FilePreferences |
Method Summary | |
protected java.lang.String[] |
childrenNamesSpi()
Returns the names of the children of this preference node. |
protected AbstractPreferences |
childSpi(java.lang.String name)
Returns the named child of this preference node, creating it if it does not already exist. |
protected void |
flushSpi()
This method is invoked with this node locked. |
protected java.io.File |
getNodeDir()
|
protected java.lang.String |
getSpi(java.lang.String key)
Return the value associated with the specified key at this preference node, or null if there is no association for this key, or the association cannot be determined at this time. |
protected java.lang.String[] |
keysSpi()
Returns all of the keys that have an associated value in this preference node. |
protected java.util.Properties |
loadProperties()
|
protected void |
putSpi(java.lang.String key,
java.lang.String value)
Put the given key-value association into this preference node. |
protected void |
removeNodeSpi()
Removes this preference node, invalidating it and any preferences that it contains. |
protected void |
removeSpi(java.lang.String key)
Remove the association (if any) for the specified key at this preference node. |
protected void |
syncSpi()
This method is invoked with this node locked. |
Methods inherited from class org.ocd.prefs.util.AbstractPreferences |
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, flush, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toString |
Methods inherited from class org.ocd.prefs.util.Preferences |
setFactory, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String PROPERTIES_FILE
Constructor Detail |
public FilePreferences(java.io.File pPrefDir)
public FilePreferences(FilePreferences parent, java.lang.String name)
Method Detail |
protected java.io.File getNodeDir()
protected java.util.Properties loadProperties()
protected void putSpi(java.lang.String key, java.lang.String value)
This method is invoked with the lock on this node held.
putSpi
in class AbstractPreferences
protected java.lang.String getSpi(java.lang.String key)
Generally speaking, this method should not throw an exception under any circumstances. If, however, if it does throw an exception, the exception will be intercepted and treated as a null return value.
This method is invoked with the lock on this node held.
getSpi
in class AbstractPreferences
protected void syncSpi() throws BackingStoreException
If this node throws a BackingStoreException, the exception
will propagate out beyond the enclosing AbstractPreferences.sync()
invocation.
syncSpi
in class AbstractPreferences
BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to
communicate with it.protected void removeNodeSpi() throws BackingStoreException
Preferences.removeNode()
method
invokes this method repeatedly in a bottom-up fashion, removing each of
a node's descendants before removing the node itself).
This method is invoked with the lock held on this node and its
parent (and all ancestors that are being removed as a
result of a single invocation to Preferences.removeNode()
).
The removal of a node needn't become persistent until the flush method is invoked on this node (or an ancestor).
If this node throws a BackingStoreException, the exception
will propagate out beyond the enclosing AbstractPreferences.removeNode()
invocation.
removeNodeSpi
in class AbstractPreferences
BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to
communicate with it.protected AbstractPreferences childSpi(java.lang.String name)
Preferences.MAX_NAME_LENGTH
characters. Also, it is guaranteed that
this node has not been removed. (The implementor needn't check for any
of these things.)
Finally, it is guaranteed that the named node has not been returned
by a previous invocation of this method or AbstractPreferences.getChild(String)
after the last time that it was removed. In other words, a cached
value will always be used in preference to invoking this method.
Subclasses need not maintain their own cache of previously returned
children.
The implementer must ensure that the returned node has not been removed. If a like-named child of this node was previously removed, the implementer must return a newly constructed AbstractPreferences node; once removed, an AbstractPreferences node cannot be "resuscitated."
If this method causes a node to be created, this node is not guaranteed to be persistent until the flush method is invoked on this node or one of its ancestors (or descendants).
This method is invoked with the lock on this node held.
childSpi
in class AbstractPreferences
name
- The name of the child node to return, relative to
this preference node.protected void flushSpi() throws BackingStoreException
If this node throws a BackingStoreException, the exception
will propagate out beyond the enclosing AbstractPreferences.flush()
invocation.
flushSpi
in class AbstractPreferences
BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to
communicate with it.protected void removeSpi(java.lang.String key)
This method is invoked with the lock on this node held.
removeSpi
in class AbstractPreferences
protected java.lang.String[] childrenNamesSpi() throws BackingStoreException
This method is invoked with the lock on this node held.
If this node throws a BackingStoreException, the exception
will propagate out beyond the enclosing AbstractPreferences.childrenNames()
invocation.
childrenNamesSpi
in class AbstractPreferences
BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to
communicate with it.protected java.lang.String[] keysSpi() throws BackingStoreException
This method is invoked with the lock on this node held.
If this node throws a BackingStoreException, the exception
will propagate out beyond the enclosing AbstractPreferences.keys()
invocation.
keysSpi
in class AbstractPreferences
BackingStoreException
- if this operation cannot be completed
due to a failure in the backing store, or inability to
communicate with it.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |