Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.configuration
Class HashtableConfigurationStore<T extends Hashtable>

java.lang.Object
  extended by net.java.sip.communicator.impl.configuration.HashtableConfigurationStore<T>
Type Parameters:
T - the hashtable extension
All Implemented Interfaces:
ConfigurationStore
Direct Known Subclasses:
DatabaseConfigurationStore, PropertyConfigurationStore

public abstract class HashtableConfigurationStore<T extends Hashtable>
extends Object
implements ConfigurationStore

Author:
Lyubomir Marinov

Field Summary
protected  T properties
          The Hashtable instance which stores the property name-value associations of this ConfigurationStore instance and which is effectively adapted by this instance to ConfigurationStore.
 
Constructor Summary
protected HashtableConfigurationStore(T properties)
           
 
Method Summary
 Object getProperty(String name)
          Implements ConfigurationStore.getProperty(String).
 String[] getPropertyNames()
          Implements ConfigurationStore.getPropertyNames().
 boolean isSystemProperty(String name)
          Implements ConfigurationStore.isSystemProperty(String).
 void removeProperty(String name)
          Implements ConfigurationStore.removeProperty(String).
 void setNonSystemProperty(String name, Object value)
          Implements ConfigurationStore.setNonSystemProperty(String, Object).
 void setSystemProperty(String name)
          Implements ConfigurationStore.setSystemProperty(String).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.java.sip.communicator.impl.configuration.ConfigurationStore
reloadConfiguration, storeConfiguration
 

Field Detail

properties

protected final T extends Hashtable properties
The Hashtable instance which stores the property name-value associations of this ConfigurationStore instance and which is effectively adapted by this instance to ConfigurationStore.

Constructor Detail

HashtableConfigurationStore

protected HashtableConfigurationStore(T properties)
Method Detail

getProperty

public Object getProperty(String name)
Implements ConfigurationStore.getProperty(String). If this ConfigurationStore contains a value associated with the specified property name, returns it. Otherwise, searches for a system property with the specified name and returns its value.

Specified by:
getProperty in interface ConfigurationStore
Parameters:
name - the name of the property to get the value of
Returns:
the value in this ConfigurationStore of the property with the specified name; null if the property with the specified name does not have an association with a value in this ConfigurationStore
See Also:
ConfigurationStore.getProperty(String)

getPropertyNames

public String[] getPropertyNames()
Implements ConfigurationStore.getPropertyNames(). Gets the names of the properties which have values associated in this ConfigurationStore.

Specified by:
getPropertyNames in interface ConfigurationStore
Returns:
an array of Strings which specify the names of the properties that have values associated in this ConfigurationStore; an empty array if this instance contains no property values
See Also:
ConfigurationStore.getPropertyNames()

isSystemProperty

public boolean isSystemProperty(String name)
Implements ConfigurationStore.isSystemProperty(String). Considers a property to be system if the system properties contain a value associated with its name.

Specified by:
isSystemProperty in interface ConfigurationStore
Parameters:
name - the name of a property which is to be determined whether it is a system property
Returns:
true if the specified name stands for a system property; false, otherwise
See Also:
ConfigurationStore.isSystemProperty(String)

removeProperty

public void removeProperty(String name)
Implements ConfigurationStore.removeProperty(String). Removes the value association in this ConfigurationStore of the property with a specific name. If the property with the specified name is not associated with a value in this ConfigurationStore, does nothing.

Specified by:
removeProperty in interface ConfigurationStore
Parameters:
name - the name of the property which is to have its value association in this ConfigurationStore removed
See Also:
ConfigurationStore.removeProperty(String)

setNonSystemProperty

public void setNonSystemProperty(String name,
                                 Object value)
Implements ConfigurationStore.setNonSystemProperty(String, Object).

Specified by:
setNonSystemProperty in interface ConfigurationStore
Parameters:
name - the name of the non-system property to be set to the specified value in this ConfigurationStore
value - the value to be assigned to the non-system property with the specified name in this ConfigurationStore
See Also:
ConfigurationStore.setNonSystemProperty(String, Object)

setSystemProperty

public void setSystemProperty(String name)
Implements ConfigurationStore.setSystemProperty(String). Since system properties are managed through the System class, setting a property as system in this ConfigurationStore effectively removes any existing value associated with the specified property name from this instance.

Specified by:
setSystemProperty in interface ConfigurationStore
Parameters:
name - the name of the property to be set as a system property in this ConfigurationStore
See Also:
ConfigurationStore.setSystemProperty(String)

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.