|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.mmm.util.component.base.AbstractComponent
net.sf.mmm.util.component.base.AbstractLoggableComponent
net.sf.mmm.util.collection.impl.CollectionFactoryManagerImpl
@Singleton @Named public class CollectionFactoryManagerImpl
This is the default implementation of the CollectionFactoryManager
interface.
| Field Summary | |
|---|---|
private Map<Class<? extends Collection>,CollectionFactory> |
collectionFactoryMap
|
private static CollectionFactoryManager |
instance
|
private Map<Class<? extends Map>,MapFactory> |
mapFactoryMap
|
| Constructor Summary | |
|---|---|
CollectionFactoryManagerImpl()
The constructor. |
|
| Method Summary | ||
|---|---|---|
protected void |
doInitialize()
This method performs the actual initialization. |
|
|
getCollectionFactory(Class<C> collectionType)
This method gets the CollectionFactory for the given
collectionType. |
|
static CollectionFactoryManager |
getInstance()
This method gets the singleton instance of this CollectionFactoryManager implementation. |
|
|
getMapFactory(Class<MAP> mapType)
This method gets the MapFactory for the given mapType. |
|
protected CollectionFactory |
registerCollectionFactory(CollectionFactory factory)
This method registers the given factory using its
collection-interface. |
|
protected
|
registerCollectionFactory(CollectionFactory<? extends COLLECTION> factory,
Class<COLLECTION> collectionInterface)
This method registers the given factory for the given
collectionInterface. |
|
protected MapFactory |
registerMapFactory(MapFactory factory)
This method registers the given factory using its
map-interface. |
|
protected
|
registerMapFactory(MapFactory<? extends MAP> factory,
Class<MAP> mapInterface)
This method registers the given factory for the given
mapInterface. |
|
| Methods inherited from class net.sf.mmm.util.component.base.AbstractLoggableComponent |
|---|
getLogger, setLogger |
| Methods inherited from class net.sf.mmm.util.component.base.AbstractComponent |
|---|
doInitialized, getInitializationState, initialize |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static CollectionFactoryManager instance
getInstance()private final Map<Class<? extends Collection>,CollectionFactory> collectionFactoryMap
getCollectionFactory(Class)private final Map<Class<? extends Map>,MapFactory> mapFactoryMap
getMapFactory(Class)| Constructor Detail |
|---|
public CollectionFactoryManagerImpl()
| Method Detail |
|---|
protected void doInitialize()
initialization. It is
called when AbstractComponent.initialize() is invoked for the first time.super.AbstractComponent.doInitialize().
doInitialize in class AbstractLoggableComponentpublic static CollectionFactoryManager getInstance()
CollectionFactoryManager implementation.getInstance() methods and
construct new instances via the container-framework of your choice (like
plexus, pico, springframework, etc.). To wire up the dependent components
everything is properly annotated using common-annotations (JSR-250). If
your container does NOT support this, you should consider using a better
one.
public <C extends Collection> CollectionFactory<C> getCollectionFactory(Class<C> collectionType)
CollectionFactory for the given
collectionType.
getCollectionFactory in interface CollectionFactoryManagerC - is the generic type of the Collection.collectionType - is the type of the Collection. This should be
the Collection interface such as
List.class.
CollectionFactory for the given
collectionType. The collectionType has to
be assignable from
CollectionFactory.getCollectionInterface() of the returned
instance. Typically it will be equal.public <MAP extends Map> MapFactory getMapFactory(Class<MAP> mapType)
MapFactory for the given mapType.
getMapFactory in interface CollectionFactoryManagerMAP - is the generic type of the Map.mapType - is the type of the Map. This should be the interface
such as Map.class or SortedMap.class.
MapFactory for the given mapType. The
mapType has to be
assignable from
MapFactory.getMapInterface() of the returned instance.
Typically it will be equal.protected MapFactory registerMapFactory(MapFactory factory)
factory using its
map-interface.
factory - is the MapFactory to register.
MapFactory that has been replaced with
factory or null if none was replaced.registerMapFactory(MapFactory, Class)
protected <MAP extends Map> MapFactory registerMapFactory(MapFactory<? extends MAP> factory,
Class<MAP> mapInterface)
factory for the given
mapInterface.
MAP - is the generic type of the mapInterface.factory - is the MapFactory to register.mapInterface - is the interface of the associated Map. It has
to be assignable from the
map-interface of the given
factory.
MapFactory that was registered for the given
mapInterface before and has now been replaced with
factory or null if none was replaced.protected CollectionFactory registerCollectionFactory(CollectionFactory factory)
factory using its
collection-interface.
factory - is the CollectionFactory to register.
CollectionFactory that has been replaced with
factory or null if none was replaced.registerCollectionFactory(CollectionFactory, Class)
protected <COLLECTION extends Collection> CollectionFactory registerCollectionFactory(CollectionFactory<? extends COLLECTION> factory,
Class<COLLECTION> collectionInterface)
factory for the given
collectionInterface.
COLLECTION - is the generic type of the
collectionInterface.factory - is the CollectionFactory to register.collectionInterface - is the interface of the associated
Collection. It has to be
assignable from the
collection-interface of the given factory.
CollectionFactory that was registered for the given
collectionInterface before and has now been replaced
with factory or null if none was
replaced.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||