Class AbstractGlueDefinition

java.lang.Object
io.cucumber.java8.AbstractGlueDefinition
All Implemented Interfaces:
Located
Direct Known Subclasses:
AbstractDatatableElementTransformerDefinition, Java8DefaultParameterTransformerDefinition, Java8DocStringTypeDefinition, Java8HookDefinition, Java8ParameterTypeDefinition, Java8StepDefinition

abstract class AbstractGlueDefinition extends Object implements Located
  • Field Details

    • body

      private @Nullable Object body
    • method

      private @Nullable Method method
    • sourceReference

      private @Nullable SourceReference sourceReference
    • parameterCount

      private int parameterCount
    • location

      final StackTraceElement location
  • Constructor Details

  • Method Details

    • updateClosure

      void updateClosure(AbstractGlueDefinition other)
    • updateClosure

      private void updateClosure(@Nullable Object body)
    • disposeClosure

      void disposeClosure()
    • getAcceptMethod

      private static Method getAcceptMethod(Class<?> bodyClass)
    • invokeMethod

      protected @Nullable Object invokeMethod(@Nullable Object... args)
    • getParameterCount

      protected int getParameterCount()
    • getLocation

      public final String getLocation()
      Description copied from interface: Located
      Location of step definition. Can either be a a method or stack trace style location.

      Examples:

      • com.example.StepDefinitions.given_an_example(io.cucumber.datatable.DataTable)
      • com.example.StepDefinitions.<init>(StepDefinitions.java:9)
      Specified by:
      getLocation in interface Located
      Returns:
      The source line of the step definition.
    • isDefinedAt

      public final boolean isDefinedAt(StackTraceElement stackTraceElement)
      Description copied from interface: Located
      Return true if this matches the location. This is used to filter stack traces.
      Specified by:
      isDefinedAt in interface Located
      Parameters:
      stackTraceElement - The location of the step.
      Returns:
      Return true if this matches the location.
    • getSourceReference

      public Optional<SourceReference> getSourceReference()
      Specified by:
      getSourceReference in interface Located
    • requireSourceReference

      SourceReference requireSourceReference()
    • resolveRawArguments

      Class<?>[] resolveRawArguments(Class<?> bodyClass, Class<?> body)