|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ice.jni.registry.RegistryKey
public class RegistryKey
The RegistryKey class represents a key in the registry. The class also provides all of the native interface calls. You should refer to the Windows Registry API documentation for the details of any of the native methods. The native implementation performs almost no processing before or after a given call, so their behavior should match the API's documented behavior precisely. Note that you can not open a subkey without an existing open RegistryKey. Thus, you need to start with one of the top level keys defined in the Registry class and open relative to that.
Registry,
RegistryValue| Field Summary | |
|---|---|
static int |
ACCESS_ALL
|
static int |
ACCESS_DEFAULT
Constants used to determine the access level for newly opened keys. |
static int |
ACCESS_EXECUTE
|
static int |
ACCESS_READ
|
static int |
ACCESS_WRITE
|
protected boolean |
created
Used to indicate whether or not the key was created when method createSubKey() is called, otherwise false. |
protected int |
hKey
This is the actual DWORD key that is returned from the Registry API. |
protected java.lang.String |
name
The full pathname of this key. |
| Constructor Summary | |
|---|---|
RegistryKey(int hKey,
java.lang.String name)
|
|
RegistryKey(int hKey,
java.lang.String name,
boolean created)
|
|
| Method Summary | |
|---|---|
void |
closeKey()
Closes this subkey. |
RegistryKey |
connectRegistry(java.lang.String hostName)
Connect to the remote registry on hostName. |
RegistryKey |
createSubKey(java.lang.String subkey,
java.lang.String className)
Create, and open, a Registry subkey of this key with WRITE access. |
RegistryKey |
createSubKey(java.lang.String subKey,
java.lang.String className,
int access)
Create a new subkey, or open the existing one. |
int |
decrDoubleWord(java.lang.String valueName)
This method will decrement the value of a REG_DWORD value. |
void |
deleteSubKey(java.lang.String subKey)
Delete a named subkey. |
void |
deleteValue(java.lang.String valueName)
Delete a named value. |
static java.lang.String |
expandEnvStrings(java.lang.String exString)
This method will expand a string to include the definitions of System environment variables that are referenced via the %variable% construct. |
void |
export(java.io.PrintWriter out,
boolean descend)
Export this key's definition to the provided PrintWriter. |
void |
finalize()
The finalize() override checks to be sure the key is closed. |
void |
flushKey()
Guarentees that this key is written to disk. |
java.lang.String |
getDefaultValue()
Get the data from the default value. |
java.lang.String |
getFullName()
Get the full name of the key, from the top level down. |
int |
getMaxSubkeyLength()
Obtains the maximum length of all of the subkey names. |
int |
getMaxValueDataLength()
Obtains the maximum length of all of the value data. |
int |
getMaxValueNameLength()
Obtains the maximum length of all of the value names. |
java.lang.String |
getName()
Get the name of this key. |
int |
getNumberSubkeys()
Obtains the number of subkeys that this key contains. |
int |
getNumberValues()
Obtains the number of values that this key contains. |
java.lang.String |
getStringValue(java.lang.String valueName)
Get the value of a REG_SZ or REG_EXPAND_SZ value. |
RegistryValue |
getValue(java.lang.String valueName)
Get the data of a named value. |
boolean |
hasDefaultValue()
Determines if this key has a default value. |
boolean |
hasOnlyDefaultValue()
Determines if this key has only a default value. |
int |
incrDoubleWord(java.lang.String valueName)
This method will increment the value of a REG_DWORD value. |
java.util.Enumeration |
keyElements()
Returns a new Enumeration that will enum_varerate the names of the subkeys of this key, |
RegistryKey |
openSubKey(java.lang.String subkey)
Open a Registry subkey of this key with READ access. |
RegistryKey |
openSubKey(java.lang.String subKey,
int access)
Open a Registry subkey of this key with the specified access. |
java.lang.String |
regEnumKey(int index)
Obtains an enum_varerator for the subkeys of this key. |
java.lang.String |
regEnumValue(int index)
Obtains an enum_varerator for the values of this key. |
void |
setCreated(boolean created)
Used to set the created state of this key. |
void |
setValue(RegistryValue value)
Set the value of this RegistryKey. |
void |
setValue(java.lang.String valueName,
RegistryValue value)
Set the name value to the given data. |
java.util.Enumeration |
valueElements()
Returns a new Enumeration that will enum_varerate the names of the values of this key, |
boolean |
wasCreated()
Determine if this key was opened or created and opened. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int ACCESS_DEFAULT
public static final int ACCESS_READ
public static final int ACCESS_WRITE
public static final int ACCESS_EXECUTE
public static final int ACCESS_ALL
protected int hKey
protected java.lang.String name
protected boolean created
| Constructor Detail |
|---|
public RegistryKey(int hKey,
java.lang.String name)
public RegistryKey(int hKey,
java.lang.String name,
boolean created)
| Method Detail |
|---|
public void finalize()
finalize in class java.lang.Objectpublic java.lang.String getName()
public java.lang.String getFullName()
public boolean wasCreated()
public void setCreated(boolean created)
created - The new created state.
public RegistryKey openSubKey(java.lang.String subkey)
throws NoSuchKeyException,
RegistryException
subkey - The name of the subkey to open.
NoSuchKeyException - If the subkey does not exist.
RegistryException - Any other registry API error.
public RegistryKey createSubKey(java.lang.String subkey,
java.lang.String className)
throws RegistryException
subkey - The name of the subkey to create.className - The className of the created subkey.
RegistryException - Any valid registry API error.
public void setValue(RegistryValue value)
throws RegistryException
value - The value to set, including the value name.
RegistryException - Any valid registry API error.
public RegistryKey openSubKey(java.lang.String subKey,
int access)
throws NoSuchKeyException,
RegistryException
subKey - The name of the subkey to open.access - The access level for the open.
NoSuchKeyException - If the subkey does not exist.
RegistryException - Any other registry API error.
public RegistryKey connectRegistry(java.lang.String hostName)
throws NoSuchKeyException,
RegistryException
hostName - The remote computer's hostname.
NoSuchKeyException - If the subkey does not exist.
RegistryException - Any other registry API error.
public RegistryKey createSubKey(java.lang.String subKey,
java.lang.String className,
int access)
throws RegistryException
subKey - The name of the subkey to create/open.className - The key's class name, or null.access - The access level of the opened subkey.
RegistryException - Any valid registry API error.
public void closeKey()
throws RegistryException
RegistryException - Any valid registry API error.
public void deleteSubKey(java.lang.String subKey)
throws NoSuchKeyException,
RegistryException
subKey - The name of the subkey to delete.
NoSuchKeyException - If the subkey does not exist.
RegistryException - Any other registry API error.
public void deleteValue(java.lang.String valueName)
throws NoSuchValueException,
RegistryException
valueName - The name of the value to delete.
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.
public void flushKey()
throws RegistryException
RegistryException - Any valid registry API error.
public void setValue(java.lang.String valueName,
RegistryValue value)
throws RegistryException
valueName - The name of the value to set.value - The data to set the named value.
RegistryException - Any valid registry API error.
public RegistryValue getValue(java.lang.String valueName)
throws NoSuchValueException,
RegistryException
valueName - The name of the value to get.
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.
public java.lang.String getStringValue(java.lang.String valueName)
throws NoSuchValueException,
RegistryException
valueName - The name of the value to get.
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.
public java.lang.String getDefaultValue()
throws NoSuchValueException,
RegistryException
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.
public boolean hasDefaultValue()
throws RegistryException
RegistryException - Any valid registry API error.
public boolean hasOnlyDefaultValue()
throws RegistryException
RegistryException - Any valid registry API error.
public int getNumberSubkeys()
throws RegistryException
RegistryException - Any valid registry API error.
public int getMaxSubkeyLength()
throws RegistryException
RegistryException - Any valid registry API error.
public java.lang.String regEnumKey(int index)
throws RegistryException
RegistryException - Any valid registry API error.
public int getNumberValues()
throws RegistryException
RegistryException - Any valid registry API error.
public int getMaxValueDataLength()
throws RegistryException
RegistryException - Any valid registry API error.
public int getMaxValueNameLength()
throws RegistryException
RegistryException - Any valid registry API error.
public java.lang.String regEnumValue(int index)
throws RegistryException
RegistryException - Any valid registry API error.
public int incrDoubleWord(java.lang.String valueName)
throws NoSuchValueException,
RegistryException
valueName - The name of the value to increment.
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.
public int decrDoubleWord(java.lang.String valueName)
throws NoSuchValueException,
RegistryException
valueName - The name of the value to increment.
NoSuchValueException - If the value does not exist.
RegistryException - Any other registry API error.public static java.lang.String expandEnvStrings(java.lang.String exString)
exString - The name of the value to increment.
public java.util.Enumeration keyElements()
throws RegistryException
RegistryException - Any valid registry API error.
public java.util.Enumeration valueElements()
throws RegistryException
RegistryException - Any valid registry API error.
public void export(java.io.PrintWriter out,
boolean descend)
throws NoSuchKeyException,
RegistryException
NoSuchKeyException - Thrown by openSubKey().
NoSuchValueException - Thrown by getValue().
RegistryException - Any other registry API error.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||