Class FieldObjectFactory<T>
- java.lang.Object
-
- org.int4.dirk.core.definition.factory.FieldObjectFactory<T>
-
- Type Parameters:
T- the type of the instances produced
- All Implemented Interfaces:
Constructable<T>
public class FieldObjectFactory<T> extends java.lang.Object implements Constructable<T>
AConstructablewhich reads a field to obtain an instance.
-
-
Constructor Summary
Constructors Constructor Description FieldObjectFactory(java.lang.reflect.Field field)Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tcreate(java.util.List<Injection> injections)Creates an instance.voiddestroy(T instance)Destroys an instance.
-
-
-
Method Detail
-
create
public T create(java.util.List<Injection> injections)
Description copied from interface:ConstructableCreates an instance.- Specified by:
createin interfaceConstructable<T>- Parameters:
injections- a list ofInjectioncontaining values to be injected, nevernullor containsnulls but can be empty- Returns:
- an instance, or
nullif it could not be provided
-
destroy
public void destroy(T instance)
Description copied from interface:ConstructableDestroys an instance.- Specified by:
destroyin interfaceConstructable<T>- Parameters:
instance- an instance to destroy, cannot benull
-
-