public class SimplePojoFactory extends AbstractLoggableComponent implements PojoFactory
PojoFactory
interface. Class.newInstance()
to create new instances
.Constructor and Description |
---|
SimplePojoFactory() |
Modifier and Type | Method and Description |
---|---|
<POJO> POJO |
newInstance(Class<POJO> pojoType)
This method creates a new instance of the given
pojoType . |
protected <POJO> POJO |
newInstanceForClass(Class<POJO> pojoType)
Implementation of
newInstance(Class) for regular class. |
protected <POJO> POJO |
newInstanceForInterface(Class<POJO> pojoInterface)
|
createLogger, doInitialize, getLogger
doInitialized, getInitializationState, initialize
public <POJO> POJO newInstance(Class<POJO> pojoType) throws InstantiationFailedException
PojoFactory
pojoType
. 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.newInstance
in interface PojoFactory
POJO
- is the generic type of the Pojo
to create.pojoType
- is the Class
reflecting the Pojo
to create.pojoType
.InstantiationFailedException
- if the instantiation failed.protected <POJO> POJO newInstanceForClass(Class<POJO> pojoType) throws InstantiationFailedException
newInstance(Class)
for regular class.POJO
- is the generic type of the Pojo
to create.pojoType
- is the Class
reflecting the Pojo
to create.pojoType
.InstantiationFailedException
- if the instantiation failed.protected <POJO> POJO newInstanceForInterface(Class<POJO> pojoInterface) throws InstantiationFailedException
POJO
- is the generic type of the Pojo
to create.pojoInterface
- is the interface reflecting the Pojo
to create.pojoType
or null
if no implementation could be found.InstantiationFailedException
- if the instantiation failed.Copyright © 2001–2016 mmm-Team. All rights reserved.