public class ObjenesisBase extends java.lang.Object implements Objenesis
限定符和类型 | 字段和说明 |
---|---|
protected java.util.Map<java.lang.String,ObjectInstantiator<?>> |
cache
Strategy cache.
|
protected InstantiatorStrategy |
strategy
Strategy used by this Objenesi implementation to create classes
|
构造器和说明 |
---|
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
|
限定符和类型 | 方法和说明 |
---|---|
<T> ObjectInstantiator<T> |
getInstantiatorOf(java.lang.Class<T> clazz)
Will pick the best instantiator for the provided class.
|
<T> T |
newInstance(java.lang.Class<T> clazz)
Will create a new object without any constructor being called
|
java.lang.String |
toString() |
protected final InstantiatorStrategy strategy
protected java.util.Map<java.lang.String,ObjectInstantiator<?>> cache
public ObjenesisBase(InstantiatorStrategy strategy)
strategy
- Strategy to usepublic ObjenesisBase(InstantiatorStrategy strategy, boolean useCache)
strategy
- Strategy to useuseCache
- If ObjectInstantiator
s should be cachedpublic java.lang.String toString()
toString
在类中 java.lang.Object
public <T> T newInstance(java.lang.Class<T> clazz)
newInstance
在接口中 Objenesis
T
- Type instantiatedclazz
- Class to instantiatepublic <T> ObjectInstantiator<T> getInstantiatorOf(java.lang.Class<T> clazz)
newInstance(Class)
.getInstantiatorOf
在接口中 Objenesis
T
- Type to instantiateclazz
- Class to instantiate