Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.java.util.prefs.gconf.GConfNativePeer
public final class GConfNativePeer
extends Object
Constructor Summary | |
|
Method Summary | |
static String |
|
protected void |
|
protected static List |
|
protected static List |
|
protected static boolean |
|
protected static String |
|
protected static String |
|
protected static boolean |
|
protected static void |
|
protected static String |
|
protected static boolean |
|
List |
|
String | |
List | |
boolean | |
boolean | |
void |
|
static String |
|
boolean |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public static String escapeString(String plain)
Escape the given string so the it is a valid GConf name.
protected void finalize() throws Throwable
Called on an object by the Virtual Machine at most once, at some point after the Object is determined unreachable but before it is destroyed. You would think that this means it eventually is called on every Object, but this is not necessarily the case. If execution terminates abnormally, garbage collection does not always happen. Thus you cannot rely on this method to always work. For finer control over garbage collection, use references from thejava.lang.ref
package. Virtual Machines are free to not call this method if they can determine that it does nothing important; for example, if your class extends Object and overrides finalize to do simplysuper.finalize()
. finalize() will be called by aThread
that has no locks on any Objects, and may be called concurrently. There are no guarantees on the order in which multiple objects are finalized. This means that finalize() is usually unsuited for performing actions that must be thread-safe, and that your implementation must be use defensive programming if it is to always work. If an Exception is thrown from finalize() during garbage collection, it will be patently ignored and the Object will still be destroyed. It is allowed, although not typical, for user code to call finalize() directly. User invocation does not affect whether automatic invocation will occur. It is also permitted, although not recommended, for a finalize() method to "revive" an object by making it reachable from normal code again. Unlike constructors, finalize() does not get called for an object's superclass unless the implementation specifically callssuper.finalize()
. The default implementation does nothing.
- Throws:
Throwable
- permits a subclass to throw anything in an overridden version; but the default throws nothing
- See Also:
System.gc()
,System.runFinalizersOnExit(boolean)
,java.lang.ref
protected static final Listgconf_all_keys(String node) throws BackingStoreException
Returns a list of all keys stored in the given node.
- Parameters:
node
- the source node.
- Returns:
- A list of all keys stored in the given node.
protected static final Listgconf_all_nodes(String node) throws BackingStoreException
Returns a list of all nodes under the given node.
- Parameters:
node
- the source node.
- Returns:
- A list of nodes under the given source node.
protected static final boolean gconf_dir_exists(String node)
Queries the GConf database to see if the given node exists, returning true if the node exist, false otherwise.
- Parameters:
node
- the node to query for existence.
- Returns:
- true if the node exist, false otherwise.
protected static final String gconf_escape_key(String plain)
Escape the input String so that it's a valid element for GConf.
- Parameters:
plain
- the String to escape.
- Returns:
- An escaped String for use with GConf.
protected static final String gconf_get_string(String key)
Returns the key associated to the given key. Null is returned if the key is not valid.
- Parameters:
key
- the key to return the value of.
- Returns:
- The value associated to the given key, or null.
protected static final boolean gconf_set_string(String key, String value)
Sets the given key/value pair into the GConf database. The key must be a valid GConf key.
- Parameters:
key
- the key to store in the GConf databasevalue
- the value to associate to the given key.
- Returns:
- true if the change has effect, false otherwise.
protected static final void gconf_suggest_sync() throws BackingStoreException
Suggest to the GConf native peer a sync with the database.
protected static final String gconf_unescape_key(String escaped)
Converts a string escaped with gconf_escape_key back into its original form.
- Parameters:
escaped
- key as returned by gconf_escape_key
- Returns:
- An unescaped key.
protected static final boolean gconf_unset(String key)
Usets the given key, removing the key from the database.
- Parameters:
key
- the key to remove.
- Returns:
- true if the operation success, false otherwise.
public ListgetChildrenNodes(String node) throws BackingStoreException
Lists the subnodes innode
. The returned list contains allocated strings. Each string is the name relative tho the given node.
- Parameters:
node
- the node to get subnodes from. If there are no subnodes in the given node, a list of size 0 is returned.
public String getKey(String key)
Gets the value of a configuration key.
- Parameters:
key
- the configuration key.
- Returns:
- the values of this key, null if the key is not valid.
public ListgetKeys(String node) throws BackingStoreException
Lists the key in the given node. Does not list subnodes. Keys names are the stripped names (name relative to the current node) of the keys stored in this node.
- Parameters:
node
- the node where keys are stored.
- Returns:
- a java.util.List of keys. If there are no keys in the given node, a list of size 0 is returned.
public boolean nodeExist(String node)
Queries whether the nodenode
exists in theGConf database. Returnstrue
orfalse
.
- Parameters:
node
- the node to check.
public boolean setString(String key, String value)
Change the value of key to val. Automatically creates the key if it didn't exist before (ie it was unset or it only had a default value). Key names must be valid GConf key names, that is, there can be more restrictions than for normal Preference Backend.
- Parameters:
key
- the key to alter (or add).value
- the new value for this key.
- Returns:
- true if the key was updated, false otherwise.
public void suggestSync() throws BackingStoreException
Suggest to the backend GConf daemon to synch with the database.
public static String unescapeString(String escaped)
Unescape a string escaped withescapeString(String)
.
public boolean unset(String key)
Unsets the value of key; if key is already unset, has no effect. Depending on the GConf daemon, unsetting a key may have the side effect to remove it completely form the database.
- Parameters:
key
- the key to unset.
- Returns:
- true on success, false if the key was not updated.