jautil.prefs
Class JAPreferencesHandler

java.lang.Object
  extended by jautil.prefs.JAPreferencesHandler

public class JAPreferencesHandler
extends java.lang.Object

A JAPreferencesHandler provides the JA system with an interface to the standard Java Preferences mechanism.


Constructor Summary
JAPreferencesHandler()
          JAPreferences handler constructor -- currently a no-op.
 
Method Summary
 void clear(java.lang.String node)
          Clears the specified JARP preferences node.
 void export(java.lang.String node, java.io.OutputStream outs)
          Exports the specified JARP preferences node to the specified output-stream.
 void export(java.lang.String node, java.lang.String path)
          Exports the specified JARP preferences node to the file with the specified path.
static java.lang.String getSystemPreference(java.lang.String skey)
          Loads and returns the jarp System preference identified by the given key.
 void importPreferences(java.io.InputStream ins)
          Imports preferences definition(s) from the specified input-stream -- just wraps a call to the corresponding Preferences method.
 void importPreferences(java.lang.String path)
          Imports preferences definition(s) from the file with the specified path.
static java.util.prefs.Preferences jarpSystemRoot()
          Returns the root node of the JARP System preferences hierarchy, having first established the local reference to this node if necessary.
 java.util.prefs.Preferences jarpUserNode(java.lang.String node)
          Returns the specified node in the JARP preferences hierarchy, that is, the node with the specified path relative to the JARP preferences root.
 boolean jarpUserNodeIsAvailable(java.lang.String node)
          Tests whether the specified node in the JARP preferences hierarchy is available, that is, whether it exists and is not the victim of a BackingStoreException.
 java.util.prefs.Preferences jarpUserRoot()
          Returns the root node of the JARP User preferences hierarchy, having first established the local reference to this node if necessary.
 void load(java.lang.String node, java.util.Properties props)
          Loads the preferences at the specified JARP node, and enters them into the given Properties set.
 void reset(java.lang.String node, java.util.Properties props)
          Updates the specified JARP preferences node, by replacing it it with the settings specified in the given Properties.
static void setSystemPreference(java.lang.String skey, java.lang.String sval)
          Sets the jarp System preference with the specified key to the specified value.
 void update(java.lang.String node, java.util.Properties props)
          Updates the specified JARP preferences node, by augmenting it with the settings specified in the given Properties.
 void updatePreference(java.lang.String node, java.lang.String key, java.lang.String value)
          Updates the JARP preferences at the given node, with the given key-value pair.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JAPreferencesHandler

public JAPreferencesHandler()
JAPreferences handler constructor -- currently a no-op.

Method Detail

jarpUserRoot

public java.util.prefs.Preferences jarpUserRoot()
Returns the root node of the JARP User preferences hierarchy, having first established the local reference to this node if necessary.


jarpUserNode

public java.util.prefs.Preferences jarpUserNode(java.lang.String node)
Returns the specified node in the JARP preferences hierarchy, that is, the node with the specified path relative to the JARP preferences root.


jarpUserNodeIsAvailable

public boolean jarpUserNodeIsAvailable(java.lang.String node)
Tests whether the specified node in the JARP preferences hierarchy is available, that is, whether it exists and is not the victim of a BackingStoreException.


export

public void export(java.lang.String node,
                   java.io.OutputStream outs)
            throws java.io.IOException,
                   java.util.prefs.BackingStoreException
Exports the specified JARP preferences node to the specified output-stream.

Throws:
java.io.IOException
java.util.prefs.BackingStoreException

export

public void export(java.lang.String node,
                   java.lang.String path)
            throws java.io.IOException,
                   java.util.prefs.BackingStoreException
Exports the specified JARP preferences node to the file with the specified path.

Throws:
java.io.IOException
java.util.prefs.BackingStoreException

importPreferences

public void importPreferences(java.io.InputStream ins)
                       throws java.io.IOException,
                              java.util.prefs.InvalidPreferencesFormatException
Imports preferences definition(s) from the specified input-stream -- just wraps a call to the corresponding Preferences method.

Throws:
java.io.IOException
java.util.prefs.InvalidPreferencesFormatException

importPreferences

public void importPreferences(java.lang.String path)
                       throws java.io.IOException,
                              java.util.prefs.InvalidPreferencesFormatException
Imports preferences definition(s) from the file with the specified path.

Throws:
java.io.IOException
java.util.prefs.InvalidPreferencesFormatException

clear

public void clear(java.lang.String node)
Clears the specified JARP preferences node.


update

public void update(java.lang.String node,
                   java.util.Properties props)
Updates the specified JARP preferences node, by augmenting it with the settings specified in the given Properties.


reset

public void reset(java.lang.String node,
                  java.util.Properties props)
Updates the specified JARP preferences node, by replacing it it with the settings specified in the given Properties.


updatePreference

public void updatePreference(java.lang.String node,
                             java.lang.String key,
                             java.lang.String value)
Updates the JARP preferences at the given node, with the given key-value pair.


load

public void load(java.lang.String node,
                 java.util.Properties props)
Loads the preferences at the specified JARP node, and enters them into the given Properties set.


jarpSystemRoot

public static java.util.prefs.Preferences jarpSystemRoot()
Returns the root node of the JARP System preferences hierarchy, having first established the local reference to this node if necessary.


getSystemPreference

public static java.lang.String getSystemPreference(java.lang.String skey)
Loads and returns the jarp System preference identified by the given key.


setSystemPreference

public static void setSystemPreference(java.lang.String skey,
                                       java.lang.String sval)
Sets the jarp System preference with the specified key to the specified value.