Class FactoryBasedInstantiator<T>
java.lang.Object
de.cuioss.test.valueobjects.objects.impl.AbstractOrderedArgsInstantiator<T>
de.cuioss.test.valueobjects.objects.impl.FactoryBasedInstantiator<T>
- Type Parameters:
T
- identifying the type of objects to be created
- All Implemented Interfaces:
ParameterizedInstantiator<T>
This
ParameterizedInstantiator
uses a factory method derived by the
given RuntimeProperties#getAllProperties()
in order to instantiate
Object
s- Author:
- Oliver Wolff
-
Constructor Summary
ConstructorsConstructorDescriptionFactoryBasedInstantiator
(Class<T> type, RuntimeProperties runtimeProperties, Class<?> enclosingType, String factoryMethodName) Constructor. -
Method Summary
Methods inherited from class de.cuioss.test.valueobjects.objects.impl.AbstractOrderedArgsInstantiator
newInstance, newInstance, newInstanceFull, newInstanceMinimal, resolveFixedArgumentList
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface de.cuioss.test.valueobjects.objects.ParameterizedInstantiator
getRuntimeProperties
-
Constructor Details
-
FactoryBasedInstantiator
public FactoryBasedInstantiator(Class<T> type, RuntimeProperties runtimeProperties, Class<?> enclosingType, String factoryMethodName) Constructor.- Parameters:
type
- the type of the object to be createdruntimeProperties
- must not be null. defines the attributes in the exact order to be used for the constructor:RuntimeProperties#getAllProperties()
enclosingType
- the type providing the factory method, usually the target type to be created, must not be nullfactoryMethodName
- the name of the factory method, must not be null, nor empty.
-
-
Method Details
-
doInstantiate
Description copied from class:AbstractOrderedArgsInstantiator
The actual instantiation method for theObject
s- Specified by:
doInstantiate
in classAbstractOrderedArgsInstantiator<T>
- Parameters:
args
- Object[] of parameter to be passed to Constructor / factory , method- Returns:
- the instantiated
Object
-
toString
-