public class SingleInstantiatorStrategy extends Object implements InstantiatorStrategy
Constructor and Description |
---|
SingleInstantiatorStrategy(Class<T> instantiator)
Create a strategy that will return always the same instantiator type.
|
Modifier and Type | Method and Description |
---|---|
<T> ObjectInstantiator<T> |
newInstantiatorOf(Class<T> type)
Return an instantiator for the wanted type and of the one and only type of instantiator returned by this
class.
|
public SingleInstantiatorStrategy(Class<T> instantiator)
T
- the type we want to instantiateinstantiator
- the instantiator typepublic <T> ObjectInstantiator<T> newInstantiatorOf(Class<T> type)
newInstantiatorOf
in interface InstantiatorStrategy
T
- the type we want to instantiatetype
- Class to instantiateCopyright © 2006–2024 Joe Walnes, Henri Tremblay, Leonardo Mesquita. All rights reserved.