org.springframework.batch.support.PropertiesConverter Java Examples

The following examples show how to use org.springframework.batch.support.PropertiesConverter. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JobExecutionThinResource.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
/**
 * @param oldParameters the latest job parameters
 * @return a String representation for rendering the job parameters from the last
 * instance
 */
private String fromJobParameters(JobParameters oldParameters) {

	String properties = PropertiesConverter.propertiesToString(converter.getProperties(oldParameters));
	if (properties.startsWith("#")) {
		properties = properties.substring(properties.indexOf(LINE_SEPARATOR) + LINE_SEPARATOR.length());
	}
	properties = properties.replace("\\:", ":");
	return properties;

}
 
Example #2
Source File: JobExecutionResource.java    From spring-cloud-dataflow with Apache License 2.0 5 votes vote down vote up
/**
 * @param oldParameters the latest job parameters
 * @return a String representation for rendering the job parameters from the last
 * instance
 */
private String fromJobParameters(JobParameters oldParameters) {

	String properties = PropertiesConverter.propertiesToString(converter.getProperties(oldParameters));
	if (properties.startsWith("#")) {
		properties = properties.substring(properties.indexOf(LINE_SEPARATOR) + LINE_SEPARATOR.length());
	}
	properties = properties.replace("\\:", ":");
	return properties;

}
 
Example #3
Source File: Util.java    From spring-batch-quartz-admin with Apache License 2.0 5 votes vote down vote up
/**
 * <p>
 * Returns a map with the job parameters
 * </p>
 *
 * @param jobName
 * @param params
 * @return Map<String, Object>
 */
public static Map<String, Object> extractJobDataMap(String jobName, String params) {
    Map<String, Object> jobDataMap = new HashMap<String, Object>();
    // Adding the job name
    jobDataMap.put(Constants.JOB_NAME, jobName);

    Properties properties = PropertiesConverter.stringToProperties(params);
    for (String propertyName : properties.stringPropertyNames()) {
        jobDataMap.put(propertyName, properties.getProperty(propertyName));
    }

    return jobDataMap;
}