public class ObjenesisBase extends Object implements Objenesis
Modifier and Type | Field and Description |
---|---|
protected Map |
cache
Strategy cache.
|
protected InstantiatorStrategy |
strategy
Strategy used by this Objenesi implementation to create classes
|
Constructor and Description |
---|
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
|
Modifier and Type | Method and Description |
---|---|
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() |
protected final InstantiatorStrategy strategy
protected Map cache
public ObjenesisBase(InstantiatorStrategy strategy)
strategy
- Strategy to usepublic ObjenesisBase(InstantiatorStrategy strategy, boolean useCache)
strategy
- Strategy to useuseCache
- If ObjectInstantiator
s should be cachedpublic Object newInstance(Class clazz)
newInstance
in interface Objenesis
clazz
- Class to instantiatepublic ObjectInstantiator getInstantiatorOf(Class clazz)
newInstance(Class)
.getInstantiatorOf
in interface Objenesis
clazz
- Class to instantiateCopyright © 2018. All rights reserved.