Package org.jboss.util.property
Class PropertyContainer
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- org.jboss.util.property.PropertyMap
-
- org.jboss.util.property.PropertyContainer
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<java.lang.Object,java.lang.Object>
public class PropertyContainer extends PropertyMap
Provides helper methods for working with instance or class properties.- Version:
- $Revision$
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
groupname
The group name for this container.private static long
serialVersionUID
The serialVersionUID-
Fields inherited from class org.jboss.util.property.PropertyMap
boundListeners, EMPTY_ARRAY_PROPERTY, PROPERTY_NAME_SEPARATOR, unboundListeners
-
-
Constructor Summary
Constructors Constructor Description PropertyContainer(java.lang.Class<?> type)
Initialize the container with a property group of the given class name.PropertyContainer(java.lang.String groupname)
Initialize the container with a property group of the given name.PropertyContainer(java.util.Properties props)
Initialize the container with a property group.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
bindField(java.lang.String name)
Creates aFieldBoundPropertyListener
for the field and property name and adds it the underlying property group.protected void
bindField(java.lang.String name, java.lang.String propertyName)
Creates aFieldBoundPropertyListener
for the field and property name and adds it the underlying property group.protected void
bindMethod(java.lang.String name)
Creates aMethodBoundPropertyListener
for the method and property name and adds it the underlying property group.protected void
bindMethod(java.lang.String name, java.lang.String propertyName)
Creates aMethodBoundPropertyListener
for the method and property name and adds it the underlying property group.private java.lang.String
makeName(java.lang.String name)
protected void
throwException(java.lang.String name)
protected void
throwException(java.lang.String name, java.lang.String msg)
protected void
throwException(java.lang.String name, java.lang.String msg, java.lang.Throwable nested)
protected void
throwException(java.lang.String name, java.lang.Throwable nested)
-
Methods inherited from class org.jboss.util.property.PropertyMap
addPropertyListener, addPropertyListener, addPropertyListeners, containsProperty, entrySet, firePropertyAdded, firePropertyChanged, firePropertyRemoved, getArrayProperty, getArrayProperty, getProperty, getPropertyGroup, getPropertyGroup, keySet, load, load, load, load, makeIndexPropertyName, makePrefixedPropertyName, names, put, remove, removeProperty, removePropertyListener, removePropertyListener, setProperty
-
Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, hashCode, isEmpty, keys, keySet, list, list, load, load, loadFromXML, merge, propertyNames, putAll, putIfAbsent, rehash, remove, replace, replace, replaceAll, save, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serialVersionUID- See Also:
- Constant Field Values
-
groupname
protected java.lang.String groupname
The group name for this container.
-
-
Constructor Detail
-
PropertyContainer
public PropertyContainer(java.util.Properties props)
Initialize the container with a property group.- Parameters:
props
-
-
PropertyContainer
public PropertyContainer(java.lang.String groupname)
Initialize the container with a property group of the given name.- Parameters:
groupname
- Property group name.
-
PropertyContainer
public PropertyContainer(java.lang.Class<?> type)
Initialize the container with a property group of the given class name.- Parameters:
type
- The class whos name will be the property group name.
-
-
Method Detail
-
bindField
protected void bindField(java.lang.String name, java.lang.String propertyName)
Creates aFieldBoundPropertyListener
for the field and property name and adds it the underlying property group.- Parameters:
name
- The field name to bind values to.propertyName
- The property name to bind to.- Throws:
java.lang.IllegalArgumentException
- Field of property name is null or empty.
-
bindField
protected void bindField(java.lang.String name)
Creates aFieldBoundPropertyListener
for the field and property name and adds it the underlying property group.- Parameters:
name
- The field name and property to bind values to.- Throws:
java.lang.IllegalArgumentException
- Field of property name is null or empty.
-
bindMethod
protected void bindMethod(java.lang.String name, java.lang.String propertyName)
Creates aMethodBoundPropertyListener
for the method and property name and adds it the underlying property group.- Parameters:
name
- The method name to bind values to.propertyName
- The property name to bind to.- Throws:
java.lang.IllegalArgumentException
- Method of property name is null or empty.
-
bindMethod
protected void bindMethod(java.lang.String name)
Creates aMethodBoundPropertyListener
for the method and property name and adds it the underlying property group.- Parameters:
name
- The method name and property to bind values to.- Throws:
java.lang.IllegalArgumentException
- Method of property name is null or empty.
-
makeName
private java.lang.String makeName(java.lang.String name)
-
throwException
protected void throwException(java.lang.String name) throws PropertyException
- Throws:
PropertyException
-
throwException
protected void throwException(java.lang.String name, java.lang.String msg) throws PropertyException
- Throws:
PropertyException
-
throwException
protected void throwException(java.lang.String name, java.lang.String msg, java.lang.Throwable nested) throws PropertyException
- Throws:
PropertyException
-
throwException
protected void throwException(java.lang.String name, java.lang.Throwable nested) throws PropertyException
- Throws:
PropertyException
-
-