Klasse PropertiesBeanProvider
- Alle implementierten Schnittstellen:
BeanProvider
A specialized BeanProvider
implementation for creating a
java.util.Properties
object.
This class works analogously to
, but it
creates a specialized map: a MapBeanProvider
Properties
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.
- Version:
- $Id: PropertiesBeanProvider.java 205 2012-01-29 18:29:57Z oheger $
- Autor:
- Oliver Heger
-
Konstruktorübersicht
KonstruktorenKonstruktorBeschreibungPropertiesBeanProvider
(Collection<Dependency> keyDeps, Collection<Dependency> valDeps) Creates a new instance ofPropertiesBeanProvider
and initializes it with the dependencies for keys and values. -
Methodenübersicht
Von Klasse geerbte Methoden net.sf.jguiraffe.di.impl.providers.MapBeanProvider
getBean, getBeanClass, getDependencies, getKeyDependencies, getValueDependencies, isOrdered
Von Klasse geerbte Methoden net.sf.jguiraffe.di.impl.providers.SimpleBeanProvider
getLockID, isBeanAvailable, setLockID, shutdown
-
Konstruktordetails
-
PropertiesBeanProvider
Creates a new instance ofPropertiesBeanProvider
and initializes it with the dependencies for keys and values. Note that theordered
flag supported by the super class does not make sense in this context.- Parameter:
keyDeps
- the dependencies for the property keys (must not be null)valDeps
- the dependencies for the property values (must not be null)- Löst aus:
IllegalArgumentException
- if eitherkeyDeps
orvalDeps
is null or the sizes of the collections are different
-
-
Methodendetails
-
createMap
Creates the map managed by this bean provider. This implementation constructs a newProperties
object.- Setzt außer Kraft:
createMap
in KlasseMapBeanProvider
- Gibt zurück:
- the map managed by this bean provider
-