net.sf.mmm.util.pojo.api
Interface PojoFactory

All Known Implementing Classes:
DefaultPojoFactory, GuessingPojoFactory, SimplePojoFactory

@ComponentSpecification
public interface PojoFactory

This is the interface for a generic factory used to create new instances of Pojos.
Pojo is a shortcut for Plain Old Java Object and simply means any Java object. Typically a Pojo has a public non-arg constructor.

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

Method Summary
<POJO> POJO
newInstance(Class<POJO> pojoType)
          This method creates a new instance of the given pojoType.
 

Method Detail

newInstance

<POJO> POJO newInstance(Class<POJO> pojoType)
                 throws InstantiationFailedException
This method creates a new instance of the given pojoType.
The simplest implementation may just delegate to Class.newInstance(). However implementations can solve arbitrary problems such as if the given pojoType has no non-arg constructor, or it is an interface or abstract class.

Type Parameters:
POJO - is the generic type of the Pojo to create.
Parameters:
pojoType - is the Class 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.