net.sf.mmm.util.pojo.base
Class DefaultPojoFactory

java.lang.Object
  extended by net.sf.mmm.util.component.base.AbstractComponent
      extended by net.sf.mmm.util.component.base.AbstractLoggableComponent
          extended by net.sf.mmm.util.pojo.base.SimplePojoFactory
              extended by net.sf.mmm.util.pojo.base.DefaultPojoFactory
All Implemented Interfaces:
PojoFactory
Direct Known Subclasses:
GuessingPojoFactory

@Singleton
public class DefaultPojoFactory
extends SimplePojoFactory

This is the default implementation of the PojoFactory interface.
It extends SimplePojoFactory with the ability to create Maps and Collections from their interfaces.

Since:
1.1.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Field Summary
private  CollectionFactoryManager collectionFactoryManager
           
 
Constructor Summary
DefaultPojoFactory()
          The constructor.
DefaultPojoFactory(CollectionFactoryManager collectionFactoryManager)
          The constructor.
 
Method Summary
protected  void doInitialize()
          This method performs the actual initialization.
protected  CollectionFactoryManager getCollectionFactoryManager()
          This method gets the CollectionFactoryManager instance used to create Maps and Collections.
protected
<POJO> POJO
newInstanceForInterface(Class<POJO> pojoInterface)
          This method is invoked from SimplePojoFactory.newInstance(Class) if the given Class is an interface.
 void setCollectionFactoryManager(CollectionFactoryManager collectionFactoryManager)
           
 
Methods inherited from class net.sf.mmm.util.pojo.base.SimplePojoFactory
newInstance, newInstanceForClass
 
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

collectionFactoryManager

private CollectionFactoryManager collectionFactoryManager
See Also:
getCollectionFactoryManager()
Constructor Detail

DefaultPojoFactory

public DefaultPojoFactory()
The constructor.


DefaultPojoFactory

public DefaultPojoFactory(CollectionFactoryManager collectionFactoryManager)
The constructor.

Parameters:
collectionFactoryManager - is the CollectionFactoryManager instance used to create Maps and Collections.
Method Detail

getCollectionFactoryManager

protected CollectionFactoryManager getCollectionFactoryManager()
This method gets the CollectionFactoryManager instance used to create Maps and Collections.

Returns:
the CollectionFactoryManager instance.

setCollectionFactoryManager

@Inject
public void setCollectionFactoryManager(CollectionFactoryManager collectionFactoryManager)
Parameters:
collectionFactoryManager - is the CollectionFactoryManager instance used to create Maps and Collections.

doInitialize

protected void doInitialize()
This method performs the actual initialization. It is called when AbstractComponent.initialize() is invoked for the first time.
ATTENTION:
When you override this method from a sub-class you need to do a super.AbstractComponent.doInitialize().

Overrides:
doInitialize in class AbstractLoggableComponent

newInstanceForInterface

protected <POJO> POJO newInstanceForInterface(Class<POJO> pojoInterface)
                                throws InstantiationFailedException
This method is invoked from SimplePojoFactory.newInstance(Class) if the given Class is an interface.

Overrides:
newInstanceForInterface in class SimplePojoFactory
Type Parameters:
POJO - is the generic type of the Pojo to create.
Parameters:
pojoInterface - is the interface reflecting the Pojo to create.
Returns:
the new instance of the given pojoType.
Throws:
InstantiationFailedException - if the instantiation failed.


Copyright © 2001-2010 mmm-Team. All Rights Reserved.