henplus
Class PropertyRegistry

java.lang.Object
  extended by henplus.PropertyRegistry

public class PropertyRegistry
extends Object

A Registry that binds names to Properties.


Constructor Summary
PropertyRegistry()
           
 
Method Summary
 SortedMap getPropertyMap()
          returns a Map view of property-Names to values.
 void registerProperty(String name, PropertyHolder holder)
          Every command or subsystem that needs to be able to set Properties, needs to register its property here.
 void setProperty(String name, String value)
          sets the Property to the given value.
 void unregisterProperty(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyRegistry

public PropertyRegistry()
Method Detail

registerProperty

public void registerProperty(String name,
                             PropertyHolder holder)
                      throws IllegalArgumentException
Every command or subsystem that needs to be able to set Properties, needs to register its property here.

Throws:
IllegalArgumentException

unregisterProperty

public void unregisterProperty(String name)

setProperty

public void setProperty(String name,
                        String value)
                 throws Exception
sets the Property to the given value. This throws an Exception, if the PropertyHolder vetoes this attempt or if there is simply no Property bound to the given name.

Parameters:
name - the name the property is bound to.
value - the new value of the property to be set.
Throws:
Exception, - if the property does not exist or throws an Exception to veto the new value.
Exception

getPropertyMap

public SortedMap getPropertyMap()
returns a Map view of property-Names to values. The returned Map must not be modified.



? 1997..2006 Henner Zeller