com.caucho.util
Class Registry

java.lang.Object
  |
  +--com.caucho.util.Registry

public final class Registry
extends java.lang.Object

The Registry is a configuration tree based on a key, value pair structure, essentially like an AList.


Method Summary
static void addListener(ChangeListener listener)
           
static RegistryNode createNode(java.lang.String name, java.lang.String value)
          Create a new RegistryNode.
static boolean getBoolean(java.lang.String path, boolean deflt)
           
static int getChangeCount()
           
static QDate getDate(java.lang.String path, QDate deflt)
           
static double getDouble(java.lang.String path, double deflt)
           
static int getInt(java.lang.String path, int deflt)
           
static long getPeriod(java.lang.String path, long deflt)
           
static RegistryNode getRegistry()
           
static java.lang.String getString(java.lang.String path, java.lang.String deflt)
           
static RegistryNode lookup(java.lang.String path)
           
static RegistryNode parse(Path path)
          Parses a registry tree from a file.
static RegistryNode parse(ReadStream is)
          Parses a registry tree from a file.
static void removeListener(ChangeListener listener)
           
static RegistryNode setDefault(RegistryNode registry)
          Sets the default configuration
static RegistryNode setRegistry(RegistryNode registry)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createNode

public static RegistryNode createNode(java.lang.String name,
                                      java.lang.String value)
Create a new RegistryNode. Use is discouraged.
Parameters:
name - name of the node
value - value of the node
Returns:
the new node

parse

public static RegistryNode parse(Path path)
                          throws java.io.IOException,
                                 SAXException
Parses a registry tree from a file.
Parameters:
path - the file containing the configuration.
Returns:
the root of the configuration tree

parse

public static RegistryNode parse(ReadStream is)
                          throws java.io.IOException,
                                 SAXException
Parses a registry tree from a file.
Parameters:
is - a stream containing the configuration.
Returns:
the root of the configuration tree.

setDefault

public static RegistryNode setDefault(RegistryNode registry)
Sets the default configuration
Parameters:
registry - configuration to be used as the new default

setRegistry

public static RegistryNode setRegistry(RegistryNode registry)

getRegistry

public static RegistryNode getRegistry()

lookup

public static RegistryNode lookup(java.lang.String path)

getBoolean

public static boolean getBoolean(java.lang.String path,
                                 boolean deflt)

getInt

public static int getInt(java.lang.String path,
                         int deflt)

getDouble

public static double getDouble(java.lang.String path,
                               double deflt)

getString

public static java.lang.String getString(java.lang.String path,
                                         java.lang.String deflt)

getDate

public static QDate getDate(java.lang.String path,
                            QDate deflt)

getPeriod

public static long getPeriod(java.lang.String path,
                             long deflt)

addListener

public static void addListener(ChangeListener listener)

getChangeCount

public static int getChangeCount()

removeListener

public static void removeListener(ChangeListener listener)