Class NoObjectFactory

java.lang.Object
io.cucumber.junit.NoObjectFactory
All Implemented Interfaces:
Container, Lookup, ObjectFactory

final class NoObjectFactory extends Object implements ObjectFactory
This object factory does nothing. It is solely needed for marking purposes.
  • Constructor Details

    • NoObjectFactory

      private NoObjectFactory()
  • Method Details

    • addClass

      public boolean addClass(Class<?> glueClass)
      Description copied from interface: Container
      Add a glue class to the test context.

      Invoked after creation but before ObjectFactory.start().

      Specified by:
      addClass in interface Container
      Parameters:
      glueClass - glue class to add to the text context.
      Returns:
      should always return true, should be ignored.
    • getInstance

      public <T> T getInstance(Class<T> glueClass)
      Description copied from interface: Lookup
      Provides an instance of a glue class.
      Specified by:
      getInstance in interface Lookup
      Type Parameters:
      T - type of Glue class
      Parameters:
      glueClass - type of instance to be created.
      Returns:
      new instance of type T
    • start

      public void start()
      Description copied from interface: ObjectFactory
      Start the object factory. Invoked once per scenario.

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

      Specified by:
      start in interface ObjectFactory
    • stop

      public void stop()
      Description copied from interface: ObjectFactory
      Stops the object factory. Called once per scenario.

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

      Specified by:
      stop in interface ObjectFactory