Package io.cucumber.picocontainer
Class PicoFactory
java.lang.Object
io.cucumber.picocontainer.PicoFactory
- All Implemented Interfaces:
Container,Lookup,ObjectFactory
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static org.picocontainer.injectors.ProviderAdapteradapterForProviderClass(Class<org.picocontainer.injectors.Provider> clazz) booleanAdd a glue class to the test context.private voidaddConstructorDependencies(Class<?> clazz) private voidaddDependency(Class<?> clazz) <T> TgetInstance(Class<T> type) Provides an instance of a glue class.private static booleanhasDefaultConstructor(Class<?> clazz) private static booleanisInstantiable(Class<?> clazz) private static booleanisProvider(Class<?> clazz) private static booleanisProviderAdapter(Class<?> clazz) private static Class<org.picocontainer.injectors.Provider> requireConstructableProvider(Class<?> clazz) voidstart()Start the object factory.voidstop()Stops the object factory.
-
Field Details
-
classes
-
providers
-
pico
private @Nullable org.picocontainer.MutablePicoContainer pico
-
-
Constructor Details
-
PicoFactory
public PicoFactory()
-
-
Method Details
-
isInstantiable
-
start
public void start()Description copied from interface:ObjectFactoryStart the object factory. Invoked once per scenario.While started
Lookup.getInstance(Class)may be invoked.- Specified by:
startin interfaceObjectFactory
-
isProvider
-
isProviderAdapter
-
adapterForProviderClass
private static org.picocontainer.injectors.ProviderAdapter adapterForProviderClass(Class<org.picocontainer.injectors.Provider> clazz) -
stop
public void stop()Description copied from interface:ObjectFactoryStops the object factory. Called once per scenario.When stopped the object factory should dispose of all glue instances.
- Specified by:
stopin interfaceObjectFactory
-
addClass
Description copied from interface:ContainerAdd a glue class to the test context.Invoked after creation but before
ObjectFactory.start(). -
addDependency
-
hasDefaultConstructor
-
requireConstructableProvider
-
getInstance
Description copied from interface:LookupProvides an instance of a glue class.- Specified by:
getInstancein interfaceLookup- Type Parameters:
T- type of Glue class- Parameters:
type- type of instance to be created.- Returns:
- new instance of type T
-
addConstructorDependencies
-