OOoRunner test harness

util
Class RegistryTools

java.lang.Object
  |
  +--util.RegistryTools

public class RegistryTools
extends Object


Constructor Summary
RegistryTools()
           
 
Method Summary
static boolean compareKeys(XRegistryKey key1, XRegistryKey key2)
          Compares two registry keys, their names, value types and values.
static boolean compareKeyTrees(XRegistryKey tree1, XRegistryKey tree2)
          Compare keys specified and all their child keys.
protected static boolean compareKeyTrees(XRegistryKey tree1, XRegistryKey tree2, boolean compareRoot)
          Compare all child keys.
static XSimpleRegistry createRegistryService(XMultiServiceFactory xMSF)
          Creates 'com.sun.star.registry.SimpleRegistry' service.
static String getShortKeyName(String keyName)
          Gets name of the key relative to its parent.
static XSimpleRegistry openRegistry(String file, XMultiServiceFactory xMSF)
          Opens registry file for reading/writing.
static void printRegistryInfo(XRegistryKey root, PrintWriter out)
          Prints to a specified output about all keys and subkeys information (key name, type, value, link target, attributes) recursively.
static void printRegistryInfo(XSimpleRegistry reg, PrintWriter out)
          Prints to a specified output about all keys and subkeys information (key name, type, value, link target, attributes) recursively.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegistryTools

public RegistryTools()
Method Detail

createRegistryService

public static XSimpleRegistry createRegistryService(XMultiServiceFactory xMSF)
                                             throws Exception
Creates 'com.sun.star.registry.SimpleRegistry' service.
Parameters:
xMSF - Multiservice factory.
Returns:
Service created.

openRegistry

public static XSimpleRegistry openRegistry(String file,
                                           XMultiServiceFactory xMSF)
                                    throws Exception
Opens registry file for reading/writing. If file doesn't exist a new one created.
Parameters:
file - Registry file name.
xMSF - Multiservice factory.
Returns:
Opened registry.

compareKeys

public static boolean compareKeys(XRegistryKey key1,
                                  XRegistryKey key2)
Compares two registry keys, their names, value types and values. return true if key names, value types and values are equal, else returns false.

getShortKeyName

public static String getShortKeyName(String keyName)
Gets name of the key relative to its parent. For example if full name of key is '/key1/subkey' short key name is 'subkey'
Parameters:
keyName - Full key name.
Returns:
Short key name.

compareKeyTrees

protected static boolean compareKeyTrees(XRegistryKey tree1,
                                         XRegistryKey tree2,
                                         boolean compareRoot)
Compare all child keys.
Parameters:
compareRoot - If true method also compare root keys, if false it begins recursive comparing from children of root keys.
Returns:
true if keys and their sub keys are equal.

compareKeyTrees

public static boolean compareKeyTrees(XRegistryKey tree1,
                                      XRegistryKey tree2)
Compare keys specified and all their child keys.
Returns:
true if keys and their sub keys are equal.

printRegistryInfo

public static void printRegistryInfo(XSimpleRegistry reg,
                                     PrintWriter out)
Prints to a specified output about all keys and subkeys information (key name, type, value, link target, attributes) recursively.
Parameters:
reg - Registry for which information is needed.
out - Output stream.

printRegistryInfo

public static void printRegistryInfo(XRegistryKey root,
                                     PrintWriter out)
Prints to a specified output about all keys and subkeys information (key name, type, value, link target, attributes) recursively.
Parameters:
root - Key for which subkeys (and further) information is required.
out - Output stream.

OOoRunner test harness