|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.prefs.Preferences
public abstract class Preferences
Abstract implementation of the javax.prefs.Preferences
class. This is an approved javax standard with no concrete implementations
available as of our implementation. Once the official implementation
is available, it will likely replace this implementation. See http://java.sun.com/aboutJava/communityprocess/jsr/jsr_010_prefs.html
for more information.
The implementation class returned by the static factory methods in this
class may be specified usin gthe system property "javax.Preferences.implementation".
This defaults to wt.prefs.WTPreferences.
Supported API: true
Extendable: false
| Method Summary | |
|---|---|
protected abstract Preferences |
child(String name)
Deprecated. |
abstract Preferences[] |
children()
Deprecated. |
void |
clear()
Deprecated. |
abstract void |
flush()
Deprecated. |
static Preferences |
forClass(Object o)
Deprecated. |
static Preferences |
forPackage(Object o)
Deprecated. |
String |
fullName()
Deprecated. |
abstract String |
get(String key,
String def)
Deprecated. |
boolean |
getBoolean(String key,
boolean def)
Deprecated. |
int |
getInt(String key,
int def)
Deprecated. |
protected void |
init(Preferences parent,
String name)
Deprecated. |
abstract String[] |
keys()
Deprecated. |
String |
name()
Deprecated. |
Preferences |
node(String pathName)
Deprecated. |
boolean |
nodeExists(String pathName)
Deprecated. |
Preferences |
parent()
Deprecated. |
abstract String |
put(String key,
String value)
Deprecated. |
void |
putBoolean(String key,
boolean value)
Deprecated. |
void |
putInt(String key,
int value)
Deprecated. |
abstract void |
refresh()
Deprecated. |
abstract String |
remove(String key)
Deprecated. |
protected abstract boolean |
removeChild(String name)
Deprecated. |
abstract boolean |
removeNode(String pathName)
Deprecated. |
static Preferences |
root()
Deprecated. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
protected abstract Preferences child(String name)
If this call causes a node to be created, this node is not guaranteed
to be persistent until the flush method is called on
this node or one of its ancestors (or descendants).
Supported API: true
name - the name of the child node to return, relative to this preference node
IllegalArgumentException - if child's name is invalid.public abstract Preferences[] children()
public void clear()
throws WTException
WTException
public abstract void flush()
throws WTException
flush, it and all
its ancestors and descendants are made permanent by this operation.
Note that this call is not guaranteed to flush any preference
values in ancestor nodes; merely the nodes' existence.
Once this method returns successfully, it is safe to assume that all changes made prior to the call have become permanent.
WTExceptionpublic static Preferences forClass(Object o)
java.lang.System
is java/lang/System.
An object wishing to access preferences pertaining to its class can obtain a preference node as follows:
Preferences prefs = Preferences.forClass(this);
Supported API: true
o -
public static Preferences forPackage(Object o)
java.lang.System
is /java/lang.
An object wishing to access preference pertaining to its package can obtain a preference node as follows:
Preferences prefs = Preferences.forPackage(this);
Supported API: true
o -
public String fullName()
public abstract String get(String key,
String def)
Some implementations may store default values in their backing
stores. If there is no value associated with the specified key, but
there is such a persistent default, it is returned in preference
to the specified default.
Supported API: true
key - key whose associated value is to be returned.def - the value to be returned in the event that this preference node has no value associated with key.
key, or def
if no value is associated with key.
public boolean getBoolean(String key,
boolean def)
key - key whose associated value is to be converted to be returned as a boolean.def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as a boolean.
key in this preference node, or null if the associated
value does not exist or cannot be interpreted as a boolean.get(String,String),
putBoolean(String,boolean)
public int getInt(String key,
int def)
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
would throw a NumberFormatException if the associated value were passed.
This convenience method is intended to be used in conjunction with
putInt.
Supported API: true
key - key whose associated value is to be converted to be returned as an int.def - the value to be returned in the event that this preference node has no value associated with key or the associated value cannot be interpreted as an int.
key
in this preference node, or null if the associated value does not
exist or cannot be interpreted as an int.get(String,String),
putInt(String,int)
protected void init(Preferences parent,
String name)
parent - the parent of this preference node, or null if this is the rootname - the name of this preference node, relative to its parent, or "" if this is the root.
IllegalArgumentException - if name contains
a slash ('/"), or parent is null and name
isn't "".
IllegalStateException - if object is already initialized.public abstract String[] keys()
public String name()
public Preferences node(String pathName)
If the returned node did not exist prior to this call, this node
and any ancestors that were created by this call are not guaranteed
to become persistent until the flush method is called
on the returned node (or one of its descendants).
Supported API: true
pathName - the path name of the preference node to return.
IllegalArgumentException - if the path name is invalidflush()public boolean nodeExists(String pathName)
pathName - the path name of the node whose existence is to be checked.
public Preferences parent()
public abstract String put(String key,
String value)
throws WTException
key - key with which the specified value is to be associated.value - value to be associated with the specified key.
null
if there was no mapping for the key.
WTException
public void putBoolean(String key,
boolean value)
throws WTException
This convenience method is inteded to be used in conjunction with
getBoolean.
Supported API: true
key - key with which the string form of value is to be associated.value - value whose string form is to be associated with key.
NullPointerException - if key is null
WTExceptiongetBoolean(String,boolean),
get(String,String)
public void putInt(String key,
int value)
throws WTException
Integer.toString(int).
this convenience method is intended to be used in conjunction with
getInt.
key - key with which the string form of value is to be associated.value - value whos e string form is to be associated with key.
WTExceptiongetInt(String, int),
get(String, String)public abstract void refresh()
flush()
public abstract String remove(String key)
throws WTException
If this implementation supports stored defaults, and there
is such a default for the specified property, the stored default will
be "exposed" by this call, in the sense that it will be returned by
a succeeding call to get.
Supported API: true
key - key whose mapping is to be removed from the preference node.
WTExceptionget(String, String)
protected abstract boolean removeChild(String name)
throws WTException
The removal of the specified node is not guaranteed to be persistent
until the flush method is called on an ancestor of the
specified node.
Supported API: true
name - the name of the child node to remove, relative to this preference node.
WTException
public abstract boolean removeNode(String pathName)
throws WTException
flushmethod is called on an ancestor of the
specified node. (It is illegal to remove the root node.)
The context of the node which is being removed will be the same edit
and search context defined for the current node. Thus a context can
delete a node and all of their subnodes, but not another context's
nodes.
pathName - the path name of the preference node to remove.
WTExceptionflush()public static Preferences root()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||