wt.prefs
Class PrefsUtil

java.lang.Object
  extended bywt.prefs.PrefsUtil

public class PrefsUtil
extends Object

Description

The PrefsUtil class is a Utility class that provides String to Preference Node transformation

See Also:
PreferenceHelper

Field Summary
private static Preferences root
          The root preference
 
Constructor Summary
PrefsUtil()
           
 
Method Summary
(package private) static String append(String nodeA, String nodeB)
          Appends nodeB to nodeA removing unnecessary separators Example: append("/foo", "bar") = "/foo/bar"

Supported API: false
static String createFullyQualifiedPreferenceName(String aNode, String aKey)
          Deprecated.  
static String createFullyQualifiedPreferenceName(String aParent, String aNode, String aKey)
          Deprecated.  
static String get(String aNode, String aKey, String aDefault)
          This method will get a preference from the Preferences Framework for the current user at the given node and key.
static HashMap getNodeValues(Preferences pref)
          Deprecated.  
(package private) static String node(String node)
          Return the node name from an absolute path Example: node("/foo/bar") = "bar"

Supported API: false
(package private) static String node(String absNode, String pathNode)
          Return relative node given an absolute and path node Example: node("/foo/bar/node", "/foo") = "bar/node"

Supported API: false
(package private) static String parent(String node)
          Return the String representing the parent of a Preference node.
static String put(String aNode, String aKey, String aValue)
          This method will insert a preference into the Preferences Framework for the current user at the given node and key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

root

private static Preferences root
The root preference

Constructor Detail

PrefsUtil

public PrefsUtil()
Method Detail

parent

static String parent(String node)
Return the String representing the parent of a Preference node. Example: parent("/foo/bar") = "/foo"

Supported API: false

Parameters:
node - String representation of node for which parent is being requested

node

static String node(String node)
Return the node name from an absolute path Example: node("/foo/bar") = "bar"

Supported API: false

Parameters:
node - absolute String representation of node

node

static String node(String absNode,
                   String pathNode)
Return relative node given an absolute and path node Example: node("/foo/bar/node", "/foo") = "bar/node"

Supported API: false

Parameters:
absNode - absolute String representation of node
pathNode - return node relative to this path

append

static String append(String nodeA,
                     String nodeB)
Appends nodeB to nodeA removing unnecessary separators Example: append("/foo", "bar") = "/foo/bar"

Supported API: false

Parameters:
nodeA - first part
nodeB - second part

getNodeValues

public static HashMap getNodeValues(Preferences pref)
Deprecated.  

This method will return a hashmap of key/value pairs for the given Preferences node. If the default value used in the get( ) method is null, therefore any value that contains a null should be assumed to have used the default, indicating the value does not exist.

Note: The contextMask should be set first using the PrefsUtil.createContextMask( ) method to ensure that the Preference node will be searched using the proper context.



Supported API: false

Replace With: wt.prefs.PreferenceHelper.getNodeValues()

Parameters:
pref - The preference node.
Returns:
the HashMap containing the key/value pairs of preference values. The map may be empty.

createFullyQualifiedPreferenceName

public static String createFullyQualifiedPreferenceName(String aParent,
                                                        String aNode,
                                                        String aKey)
Deprecated.  

This method will create a full path name attribute from a Parent, Node and Key much like the Database view.

Supported API: false

Replace With: wt.prefs.PreferenceHelper.createFullyQualifiedPreferenceName

Parameters:
aParent - The parent preference
aNode - The preference node
aKey - The preference key
Returns:
The full path name

createFullyQualifiedPreferenceName

public static final String createFullyQualifiedPreferenceName(String aNode,
                                                              String aKey)
Deprecated.  

This method will create a full path name attribute from a Parent, Node and Key much like the Database view.

Supported API: false

Replace With: wt.prefs.PreferenceHelper.createFullyQualifiedPreferenceName

Parameters:
aNode - The preference node
aKey - The preference key
Returns:
The full path name

get

public static final String get(String aNode,
                               String aKey,
                               String aDefault)
This method will get a preference from the Preferences Framework for the current user at the given node and key.

Supported API: false

Parameters:
aNode - The node to the preference (for example "/wt/doc" )
aKey - The key name of the preference
aDefault - The value to use as the default if there is no preference
Returns:
The value of the preference or default if the preference is not found.

put

public static final String put(String aNode,
                               String aKey,
                               String aValue)
                        throws WTException
This method will insert a preference into the Preferences Framework for the current user at the given node and key.

Supported API: false

Parameters:
aNode - The node to the preference (for example "/wt/doc" )
aKey - The key name of the preference
aValue - The value to insert for the preference
Returns:
The previous value, or null if there is no value.
Throws:
WTException