站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss 4.0.1 sp1 common API Documentation 英文版文档

PropertyGroup (JBoss/Common API) - JBoss 4.0.1 sp1 common API Documentation 英文版文档


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
                  extended byorg.jboss.util.property.PropertyGroup
All Implemented Interfaces:
Cloneable, Map, Serializable

public class PropertyGroup
extends PropertyMap

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.

Version:
$Revision: 1.4 $
Author:
Jason Dillon
See Also:
Serialized Form

Field Summary
protected  String basename
          Base property name
 
Fields inherited from class org.jboss.util.property.PropertyMap
boundListeners, EMPTY_ARRAY_PROPERTY, PROPERTY_NAME_SEPARATOR, unboundListeners
 
Fields inherited from class java.util.Properties
defaults
 
Constructor Summary
PropertyGroup(String basename, Properties container)
          Construct a PropertyGroup.
 
Method Summary
protected  void addPropertyListener(BoundPropertyListener listener)
          Add a bound property listener.
 boolean containsKey(Object name)
          Check if this PropertyMap contains a given property name.
 Set entrySet()
          Returns an entry set for all properties in this group.
 Object get(Object name)
          Get a property
 String getBaseName()
          Get the base property name for this group.
 Object put(Object name, Object value)
          Set a property.
 Object remove(Object name)
          Remove a property.
protected  boolean removePropertyListener(BoundPropertyListener listener)
          Remove a bound property listener.
 
Methods inherited from class org.jboss.util.property.PropertyMap
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 String basename
Base property name

Constructor Detail

PropertyGroup

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

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

getBaseName

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

Returns:
Base property name.

containsKey

public boolean containsKey(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 Object put(Object name,
                  Object value)
Set a property.

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

get

public Object get(Object name)
Get a property

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

remove

public Object remove(Object name)
Remove a property.

Specified by:
remove in interface Map
Overrides:
remove in class PropertyMap
Parameters:
name - Property name.
Returns:
Removed property value.

entrySet

public 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 listener)
Add a bound property listener.

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

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

removePropertyListener

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

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

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


Copyright © 2002 JBoss Group, LLC. All Rights Reserved.