|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.objenesis.ObjenesisBase
Base class to extend if you want to have a class providing your own default strategy. Can also be instantiated directly.
Field Summary | |
---|---|
protected Map |
cache
Strategy cache. |
protected InstantiatorStrategy |
strategy
Strategy used by this Objenesi implementation to create classes |
Constructor Summary | |
---|---|
ObjenesisBase(InstantiatorStrategy strategy)
Constructor allowing to pick a strategy and using cache |
|
ObjenesisBase(InstantiatorStrategy strategy,
boolean useCache)
Flexible constructor allowing to pick the strategy and if caching should be used |
Method Summary | |
---|---|
ObjectInstantiator |
getInstantiatorOf(Class clazz)
Will pick the best instantiator for the provided class. |
Object |
newInstance(Class clazz)
Will create a new object without any constructor being called |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final InstantiatorStrategy strategy
protected Map cache
Constructor Detail |
---|
public ObjenesisBase(InstantiatorStrategy strategy)
strategy
- Strategy to usepublic ObjenesisBase(InstantiatorStrategy strategy, boolean useCache)
strategy
- Strategy to useuseCache
- If ObjectInstantiator
s should be cachedMethod Detail |
---|
public String toString()
public Object newInstance(Class clazz)
newInstance
in interface Objenesis
clazz
- Class to instantiate
public ObjectInstantiator getInstantiatorOf(Class clazz)
newInstance(Class)
.
getInstantiatorOf
in interface Objenesis
clazz
- Class to instantiate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |