eu.semiramis.policyManager.util
Class ConfigurationProperties

java.lang.Object
  extended by java.util.Dictionary<K,V>
      extended by java.util.Hashtable<java.lang.Object,java.lang.Object>
          extended by java.util.Properties
              extended by eu.semiramis.policyManager.util.ConfigurationProperties
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.Object,java.lang.Object>

public class ConfigurationProperties
extends java.util.Properties

Extension of Properties that load properties from a resource (e.g. a file). Each time a property is asked, the resource is checked for modifications and properties are reloaded if needed.

Author:
Paolo Roccetti
See Also:
Serialized Form

Constructor Summary
ConfigurationProperties(java.lang.String resourceName)
          Creates a new ConfigurationProperties linked to the given resource
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.lang.String getProperty(java.lang.String key)
           
 java.lang.String getProperty(java.lang.String key, java.lang.String defaultValue)
           
 java.util.Enumeration<?> propertyNames()
           
 java.util.Set<java.lang.String> stringPropertyNames()
           
 java.lang.String toString()
           
 
Methods inherited from class java.util.Properties
list, list, load, load, loadFromXML, save, setProperty, store, store, storeToXML, storeToXML
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, get, hashCode, isEmpty, keys, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConfigurationProperties

public ConfigurationProperties(java.lang.String resourceName)
                        throws java.io.IOException,
                               java.net.URISyntaxException
Creates a new ConfigurationProperties linked to the given resource

Parameters:
resourceName - the resource name
Throws:
java.net.URISyntaxException - if the resource name is not well formed
java.io.IOException - if the load operation fails
Method Detail

getProperty

public java.lang.String getProperty(java.lang.String key)
Overrides:
getProperty in class java.util.Properties

getProperty

public java.lang.String getProperty(java.lang.String key,
                                    java.lang.String defaultValue)
Overrides:
getProperty in class java.util.Properties

propertyNames

public java.util.Enumeration<?> propertyNames()
Overrides:
propertyNames in class java.util.Properties

stringPropertyNames

public java.util.Set<java.lang.String> stringPropertyNames()
Overrides:
stringPropertyNames in class java.util.Properties

equals

public boolean equals(java.lang.Object o)
Specified by:
equals in interface java.util.Map<java.lang.Object,java.lang.Object>
Overrides:
equals in class java.util.Hashtable<java.lang.Object,java.lang.Object>

toString

public java.lang.String toString()
Overrides:
toString in class java.util.Hashtable<java.lang.Object,java.lang.Object>