public class PropertiesBeanProvider extends MapBeanProvider
A specialized BeanProvider implementation for creating a
java.util.Properties object.
This class works analogously to , but it
creates a specialized map: a MapBeanProviderProperties object. Because the
major part of the functionality required is already implemented by the super
class this implementation can be very simple. It merely has to override the
createMap() method to return a Properties instance.
This class stands in a similar relation to MapBeanProvider as
java.util.Properties stands to its ancestor
java.util.HashMap: Properties operates on string
keys and values, but through the methods inherited from its base class it is
possible to store data of other types as well. The same is true for this
BeanProvider implementation. It accepts any kind of dependencies
for keys and values and does not perform a type check. So it lies in the
responsibility of the user to populate the Properties object
only with valid keys and values.
| Constructor and Description |
|---|
PropertiesBeanProvider(Collection<Dependency> keyDeps,
Collection<Dependency> valDeps)
Creates a new instance of
PropertiesBeanProvider and
initializes it with the dependencies for keys and values. |
| Modifier and Type | Method and Description |
|---|---|
protected Map<Object,Object> |
createMap()
Creates the map managed by this bean provider.
|
getBean, getBeanClass, getDependencies, getKeyDependencies, getValueDependencies, isOrderedgetLockID, isBeanAvailable, setLockID, shutdownpublic PropertiesBeanProvider(Collection<Dependency> keyDeps, Collection<Dependency> valDeps)
PropertiesBeanProvider and
initializes it with the dependencies for keys and values. Note that the
ordered flag supported by the super class does not make
sense in this context.keyDeps - the dependencies for the property keys (must not be
null)valDeps - the dependencies for the property values (must not be
null)IllegalArgumentException - if either keyDeps or
valDeps is null or the sizes of the
collections are differentprotected Map<Object,Object> createMap()
Properties object.createMap in class MapBeanProviderCopyright © 2016 The JGUIraffe Team. All rights reserved.