Class DefaultJobParametersConverter

java.lang.Object
org.springframework.batch.core.converter.DefaultJobParametersConverter
All Implemented Interfaces:
JobParametersConverter
Direct Known Subclasses:
JsonJobParametersConverter

public class DefaultJobParametersConverter extends Object implements JobParametersConverter
Converter for JobParameters instances that uses a simple naming convention for converting job parameters. The expected notation is the following:

key=value,type,identifying

where:

  • value: string literal representing the value
  • type (optional): fully qualified name of the type of the value. Defaults to String.
  • identifying (optional): boolean to flag the job parameter as identifying or not. Defaults to true
For example, schedule.date=2022-12-12,java.time.LocalDate will be converted to an identifying job parameter of type LocalDate with value "2022-12-12".

The literal values are converted to the target type by using the default Spring conversion service, augmented if necessary by any custom converters. The conversion service should be configured with a converter to and from string literals to job parameter types.

By default, the Spring conversion service is augmented to support the conversion of the following types:

Author:
Dave Syer, Michael Minella, Mahmoud Ben Hassine
  • Field Details

    • conversionService

      protected org.springframework.core.convert.support.ConfigurableConversionService conversionService
  • Constructor Details

    • DefaultJobParametersConverter

      public DefaultJobParametersConverter()
  • Method Details