org.jboss.util.property
Class PropertyGroup

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byjava.util.Properties
              extended byorg.jboss.util.property.PropertyMap (src) 
                  extended byorg.jboss.util.property.PropertyGroup
All Implemented Interfaces:
java.lang.Cloneable, java.util.Map, java.io.Serializable

public class PropertyGroup
extends PropertyMap (src)

This is a helper class to access a group of properties with out having to refer to their full names.

This class needs more work to be fully functional. It should suffice for adding property listeners and getting/setting property values, but other activies might not work out so well.

See Also:
Serialized Form

Field Summary
protected  java.lang.String basename
          Base property name
 
Fields inherited from class org.jboss.util.property.PropertyMap (src)
boundListeners, EMPTY_ARRAY_PROPERTY, PROPERTY_NAME_SEPARATOR, unboundListeners
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertyGroup(java.lang.String basename, java.util.Properties container)
          Construct a PropertyGroup.
 
Method Summary
protected  void addPropertyListener(BoundPropertyListener (src)  listener)
          Add a bound property listener.
 boolean containsKey(java.lang.Object name)
          Check if this PropertyMap contains a given property name.
 java.util.Set entrySet()
          Returns an entry set for all properties in this group.
 java.lang.Object get(java.lang.Object name)
          Get a property
 java.lang.String getBaseName()
          Get the base property name for this group.
 java.lang.Object put(java.lang.Object name, java.lang.Object value)
          Set a property.
 java.lang.Object remove(java.lang.Object name)
          Remove a property.
protected  boolean removePropertyListener(BoundPropertyListener (src)  listener)
          Remove a bound property listener.
 
Methods inherited from class org.jboss.util.property.PropertyMap (src)
addPropertyListener, addPropertyListeners, containsProperty, entrySet, firePropertyAdded, firePropertyChanged, firePropertyRemoved, getArrayProperty, getArrayProperty, getProperty, getPropertyGroup, getPropertyGroup, keySet, load, load, load, load, makeIndexPropertyName, makePrefixedPropertyName, names, removeProperty, removePropertyListener, setProperty
 
Methods inherited from class java.util.Properties
getProperty, list, list, load, propertyNames, save, store
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsValue, elements, equals, hashCode, isEmpty, keys, keySet, putAll, rehash, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

basename

protected final java.lang.String basename
Base property name

Constructor Detail

PropertyGroup

public PropertyGroup(java.lang.String basename,
                     java.util.Properties container)
Construct a PropertyGroup.

Parameters:
basename - Base property name.
container - Property container.
Throws:
NullArgumentException (src) - Basename is null.
Method Detail

getBaseName

public final java.lang.String getBaseName()
Get the base property name for this group.

Returns:
Base property name.

containsKey

public boolean containsKey(java.lang.Object name)
Check if this PropertyMap contains a given property name.

Parameters:
name - Property name.
Returns:
True if property map or defaults contains key.

put

public java.lang.Object put(java.lang.Object name,
                            java.lang.Object value)
Set a property.

Specified by:
put in interface java.util.Map
Overrides:
put in class PropertyMap (src)
Parameters:
name - Property name.
value - Property value.
Returns:
Previous property value or null.

get

public java.lang.Object get(java.lang.Object name)
Get a property

Parameters:
name - Property name.
Returns:
Property value or null.

remove

public java.lang.Object remove(java.lang.Object name)
Remove a property.

Specified by:
remove in interface java.util.Map
Overrides:
remove in class PropertyMap (src)
Parameters:
name - Property name.
Returns:
Removed property value.

entrySet

public java.util.Set entrySet()
Returns an entry set for all properties in this group.

This is currently ver inefficient, but should get the job done for now.


addPropertyListener

protected void addPropertyListener(BoundPropertyListener (src)  listener)
Add a bound property listener.

Generates a fully qualified property name and adds the listener under that name.

Overrides:
addPropertyListener in class PropertyMap (src)
Parameters:
listener - Bound property listener to add.

removePropertyListener

protected boolean removePropertyListener(BoundPropertyListener (src)  listener)
Remove a bound property listener.

Generates a fully qualified property name and removes the listener under that name.

Overrides:
removePropertyListener in class PropertyMap (src)
Parameters:
listener - Bound property listener to remove.
Returns:
True if listener was removed.