class DefaultJobParametersExtractor implements JobParametersExtractor {

	private Set<String> keys = new HashSet<>();

	private boolean useAllParentParameters = true;

	private JobParametersConverter jobParametersConverter = new DefaultJobParametersConverter();

	/**
	 * The key names to pull out of the execution context or job parameters, if they
	 * exist. If a key doesn't exist in the execution context then the job parameters from
	 * the enclosing job execution are tried, and if there is nothing there either then no
	 * parameter is extracted.
	 * @param keys the keys to set
	 */
	public void setKeys(String[] keys) {
		this.keys = new HashSet<>(Arrays.asList(keys));
	}

	/**
	 * @see JobParametersExtractor#getJobParameters(Job, StepExecution)
	 */
	@Override
	public JobParameters getJobParameters(Job job, StepExecution stepExecution) {<FILL_FUNCTION_BODY>}

	/**
	 * setter to support switching off all parent parameters
	 * @param useAllParentParameters if false do not include parent parameters. True if
	 * all parent parameters need to be included.
	 */
	public void setUseAllParentParameters(boolean useAllParentParameters) {
		this.useAllParentParameters = useAllParentParameters;
	}

	/**
	 * Set the {@link JobParametersConverter} to use.
	 * @param jobParametersConverter the converter to use. Must not be {@code null}.
	 */
	public void setJobParametersConverter(@NonNull JobParametersConverter jobParametersConverter) {
		Assert.notNull(jobParametersConverter, "jobParametersConverter must not be null");
		this.jobParametersConverter = jobParametersConverter;
	}

}

		JobParametersBuilder builder = new JobParametersBuilder();
		Map<String, JobParameter<?>> jobParameters = stepExecution.getJobParameters().getParameters();
		ExecutionContext executionContext = stepExecution.getExecutionContext();
		if (useAllParentParameters) {
			for (String key : jobParameters.keySet()) {
				builder.addJobParameter(key, jobParameters.get(key));
			}
		}
		Properties properties = new Properties();
		for (String key : keys) {
			if (executionContext.containsKey(key)) {
				properties.setProperty(key, executionContext.getString(key));
			}
			else if (jobParameters.containsKey(key)) {
				builder.addJobParameter(key, jobParameters.get(key));
			}
		}
		builder.addJobParameters(this.jobParametersConverter.getJobParameters(properties));
		return builder.toJobParameters();
	
<no_super_class>