Class ParameterConverters

java.lang.Object
org.jbehave.core.steps.ParameterConverters

public class ParameterConverters extends Object

Facade responsible for converting parameter values to Java objects. It allows the registration of several ParameterConverters.ParameterConverter instances, and the first one that is found to matches the appropriate parameter type is used.

Converters for several Java types are provided out-of-the-box:

  • Field Details

    • DEFAULT_STEP_MONITOR

      public static final StepMonitor DEFAULT_STEP_MONITOR
    • DEFAULT_NUMBER_FORMAT_LOCAL

      public static final Locale DEFAULT_NUMBER_FORMAT_LOCAL
    • DEFAULT_COLLECTION_SEPARATOR

      public static final String DEFAULT_COLLECTION_SEPARATOR
      See Also:
    • DEFAULT_THREAD_SAFETY

      public static final boolean DEFAULT_THREAD_SAFETY
      See Also:
  • Constructor Details

    • ParameterConverters

      public ParameterConverters()
      Creates a ParameterConverters using the default resource loader and table transformers, a SilentStepMonitor, English as Locale and "," as collection separator.
    • ParameterConverters

      public ParameterConverters(TableTransformers tableTransformers)
      Creates a ParameterConverters using the given table transformers.
      Parameters:
      tableTransformers - the table transformers
    • ParameterConverters

      public ParameterConverters(ResourceLoader resourceLoader)
      Creates a ParameterConverters of ParameterConverters using the given resource loader.
      Parameters:
      resourceLoader - the resource loader
    • ParameterConverters

      public ParameterConverters(ResourceLoader resourceLoader, TableTransformers tableTransformers)
      Creates a ParameterConverters given resource loader and table transformers.
      Parameters:
      resourceLoader - the resource loader
      tableTransformers - the table transformers
    • ParameterConverters

      public ParameterConverters(StepMonitor monitor, ResourceLoader resourceLoader, ParameterControls parameterControls, TableTransformers tableTransformers)
      Creates a ParameterConverters using given StepMonitor, resource loader and table transformers.
      Parameters:
      monitor - the StepMonitor to use
      resourceLoader - the resource loader
      parameterControls - the parameter controls
      tableTransformers - the table transformers
    • ParameterConverters

      public ParameterConverters(StepMonitor monitor, Keywords keywords, ResourceLoader resourceLoader, ParameterControls parameterControls, TableTransformers tableTransformers)
      Creates a ParameterConverters using given StepMonitor, keywords, resource loader and table transformers.
      Parameters:
      monitor - the StepMonitor to use
      keywords - the keywords to use
      resourceLoader - the resource loader
      parameterControls - the parameter controls
      tableTransformers - the table transformers
    • ParameterConverters

      public ParameterConverters(ResourceLoader resourceLoader, ParameterControls parameterControls, TableTransformers tableTransformers, boolean threadSafe)
      Create a ParameterConverters with given thread-safety
      Parameters:
      resourceLoader - the resource loader
      parameterControls - the parameter controls
      tableTransformers - the table transformers
      threadSafe - the boolean flag to determine if access to ParameterConverters.ParameterConverter should be thread-safe
    • ParameterConverters

      public ParameterConverters(StepMonitor monitor, ResourceLoader resourceLoader, ParameterControls parameterControls, TableTransformers tableTransformers, Locale locale, String collectionSeparator, boolean threadSafe)
      Creates a ParameterConverters for the given StepMonitor, Locale, list separator and thread-safety. When selecting a collectionSeparator, please make sure that this character doesn't have a special meaning in your Locale (for instance "," is used as decimal separator in some Locale)
      Parameters:
      monitor - the StepMonitor reporting the conversions
      resourceLoader - the resource loader
      parameterControls - the parameter controls
      tableTransformers - the table transformers
      locale - the Locale to use when reading numbers
      collectionSeparator - the String to use as collection separator
      threadSafe - the boolean flag to determine if modification of ParameterConverters.ParameterConverter should be thread-safe
    • ParameterConverters

      public ParameterConverters(StepMonitor monitor, Keywords keywords, ResourceLoader resourceLoader, ParameterControls parameterControls, TableTransformers tableTransformers, Locale locale, String collectionSeparator, boolean threadSafe)
      Creates a ParameterConverters for the given StepMonitor, keywords, Locale, list separator and thread-safety. When selecting a collectionSeparator, please make sure that this character doesn't have a special meaning in your Locale (for instance "," is used as decimal separator in some Locale)
      Parameters:
      monitor - the StepMonitor reporting the conversions
      resourceLoader - the resource loader
      keywords - the keywords
      parameterControls - the parameter controls
      tableTransformers - the table transformers
      locale - the Locale to use when reading numbers
      collectionSeparator - the String to use as collection separator
      threadSafe - the boolean flag to determine if modification of ParameterConverters.ParameterConverter should be thread-safe
    • ParameterConverters

      public ParameterConverters(StepMonitor monitor, Keywords keywords, ResourceLoader resourceLoader, ParameterControls parameterControls, TableParsers tableParsers, TableTransformers tableTransformers, Locale locale, String collectionSeparator, boolean threadSafe)
      Creates a ParameterConverters for the given StepMonitor, keywords, Locale, list separator and thread-safety. When selecting a collectionSeparator, please make sure that this character doesn't have a special meaning in your Locale (for instance "," is used as decimal separator in some Locale)
      Parameters:
      monitor - the StepMonitor reporting the conversions
      resourceLoader - the resource loader
      keywords - the keywords
      parameterControls - the parameter controls
      tableParsers - the table parsers
      tableTransformers - the table transformers
      locale - the Locale to use when reading numbers
      collectionSeparator - the String to use as collection separator
      threadSafe - the boolean flag to determine if modification of ParameterConverters.ParameterConverter should be thread-safe
  • Method Details