Interface ObjectFactory

All Superinterfaces:
Container, Lookup
All Known Implementing Classes:
DefaultObjectFactory

@API(status=STABLE) public interface ObjectFactory extends Container, Lookup
Instantiates glue classes. Loaded via SPI.

Cucumber scenarios are executed against a test context that consists of multiple glue classes. These must be instantiated and may optionally be injected with dependencies. The object factory facilitates the creation of both the glue classes and dependencies.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Start the object factory.
    void
    Stops the object factory.

    Methods inherited from interface io.cucumber.core.backend.Container

    addClass

    Methods inherited from interface io.cucumber.core.backend.Lookup

    getInstance
  • Method Details

    • start

      void start()
      Start the object factory. Invoked once per scenario.

      While started Lookup.getInstance(Class) may be invoked.

    • stop

      void stop()
      Stops the object factory. Called once per scenario.

      When stopped the object factory should dispose of all glue instances.