public class GuessingPojoFactory extends DefaultPojoFactory
PojoFactory
interface. DefaultPojoFactory
it tries to find implementations for interfaces by guessing according to
conventions:some.package.api.Foo
it will try to find the following classes...
some.package.api.FooImpl
some.package.api.impl.FooImpl
some.package.impl.FooImpl
(only if package of interface ends with ".api")Modifier and Type | Field and Description |
---|---|
private static String |
API_PKG_SUFFIX
The conventional suffix for an api package.
|
private static String |
IMPL_CLASS_SUFFIX
The conventional suffix for an implementation class.
|
private static String |
IMPL_PKG_SUFFIX
The conventional suffix for an implementation package.
|
Constructor and Description |
---|
GuessingPojoFactory()
The constructor.
|
GuessingPojoFactory(CollectionFactoryManager collectionFactoryManager)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected <POJO> POJO |
newInstanceForInterface(Class<POJO> pojoInterface)
This method is invoked from
SimplePojoFactory.newInstance(Class) if the given Class is an interface . |
doInitialize, getCollectionFactoryManager, setCollectionFactoryManager
newInstance, newInstanceForClass
createLogger, getLogger
doInitialized, getInitializationState, initialize
private static final String IMPL_CLASS_SUFFIX
private static final String IMPL_PKG_SUFFIX
private static final String API_PKG_SUFFIX
public GuessingPojoFactory()
public GuessingPojoFactory(CollectionFactoryManager collectionFactoryManager)
collectionFactoryManager
- is the CollectionFactoryManager
instance used to create
Map
s and Collection
s.protected <POJO> POJO newInstanceForInterface(Class<POJO> pojoInterface) throws InstantiationFailedException
DefaultPojoFactory
SimplePojoFactory.newInstance(Class)
if the given Class
is an interface
.newInstanceForInterface
in class DefaultPojoFactory
POJO
- is the generic type of the Pojo
to create.pojoInterface
- is the interface reflecting the Pojo
to create.pojoType
.InstantiationFailedException
- if the instantiation failed.Copyright © 2001–2016 mmm-Team. All rights reserved.