All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.cucumber.scala.ScalaDataTableCellDefinition.scala Maven / Gradle / Ivy

There is a newer version: 8.24.0
Show newest version
package io.cucumber.scala

import io.cucumber.core.backend.ScenarioScoped
import io.cucumber.datatable.{DataTableType, TableCellTransformer}

trait ScalaDataTableCellDefinition[T] extends ScalaDataTableTypeDefinition {

  val details: ScalaDataTableCellTypeDetails[T]

  override val emptyPatterns: Seq[String] = details.emptyPatterns

  override val location: StackTraceElement = new Exception().getStackTrace()(3)

  private val transformer: TableCellTransformer[T] = (cell: String) => {
    details.body.transform(replaceEmptyPatternsWithEmptyString(cell))
  }

  override val dataTableType =
    new DataTableType(details.tag.runtimeClass, transformer)

}

class ScalaScenarioScopedDataTableCellDefinition[T](
    override val details: ScalaDataTableCellTypeDetails[T]
) extends ScalaDataTableCellDefinition[T]
    with ScenarioScoped {}

class ScalaGlobalDataTableCellDefinition[T](
    override val details: ScalaDataTableCellTypeDetails[T]
) extends ScalaDataTableCellDefinition[T] {}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy