Skip to content

Commit 61ea236

Browse files
Jay Bryantfmbenhassine
Jay Bryant
authored andcommitted
Javadoc editing
for grammar, punctuation, usage, and (sometimes) missing content.
1 parent e6e21c5 commit 61ea236

File tree

2 files changed

+29
-26
lines changed

2 files changed

+29
-26
lines changed

spring-batch-core/src/main/java/org/springframework/batch/core/converter/DefaultJobParametersConverter.java

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,20 @@
3636
import java.util.Properties;
3737

3838
/**
39-
* Converter for {@link JobParameters} instances using a simple naming convention for
40-
* property keys. Key names that are prefixed with a - are considered non-identifying and
41-
* will not contribute to the identity of a {@link JobInstance}. Key names ending with
42-
* "(<type>)" where type is one of string, date, long are converted to the
43-
* corresponding type. The default type is string. E.g.
39+
* Converter for {@link JobParameters} instances that uses a simple naming convention for
40+
* property keys. Key names that are prefixed with a {@code -} are considered
41+
* non-identifying and do not contribute to the identity of a {@link JobInstance}. Key
42+
* names ending with "(<type>)" (where type is one of string, date, long) are
43+
* converted to the corresponding type. The default type is string. Consider the following
44+
* example:
4445
*
4546
* <pre>
4647
* schedule.date(date)=2007/12/11
4748
* department.id(long)=2345
4849
* </pre>
4950
*
50-
* The literal values are converted to the correct type using the default Spring
51-
* strategies, augmented if necessary by the custom editors provided.
51+
* The literal values are converted to the correct type by using the default Spring
52+
* strategies, augmented if necessary by any custom editors that have been provided.
5253
*
5354
* <br>
5455
*
@@ -96,9 +97,9 @@ public class DefaultJobParametersConverter implements JobParametersConverter {
9697
private final NumberFormat longNumberFormat = new DecimalFormat("#");
9798

9899
/**
99-
* Check for suffix on keys and use those to decide how to convert the value.
100+
* Check for a suffix on keys and use those to decide how to convert the value.
100101
* @throws IllegalArgumentException if a number or date is passed in that cannot be
101-
* parsed, or cast to the correct type.
102+
* parsed or cast to the correct type.
102103
*
103104
* @see org.springframework.batch.core.converter.JobParametersConverter#getJobParameters(java.util.Properties)
104105
*/
@@ -175,7 +176,7 @@ private boolean isIdentifyingKey(String key) {
175176
}
176177

177178
/**
178-
* Delegate to {@link NumberFormat} to parse the value
179+
* Delegate to {@link NumberFormat} to parse the value.
179180
*/
180181
private Number parseNumber(String value) {
181182
synchronized (numberFormat) {
@@ -192,9 +193,9 @@ private Number parseNumber(String value) {
192193

193194
/**
194195
* Use the same suffixes to create properties (omitting the string suffix because it
195-
* is the default). Non-identifying parameters will be prefixed with the
196+
* is the default). Non-identifying parameters are prefixed with the
196197
* {@link #NON_IDENTIFYING_FLAG}. However, since parameters are identifying by
197-
* default, they will <em>not</em> be prefixed with the {@link #IDENTIFYING_FLAG}.
198+
* default, they are <em>not</em> prefixed with the {@link #IDENTIFYING_FLAG}.
198199
*
199200
* @see org.springframework.batch.core.converter.JobParametersConverter#getProperties(org.springframework.batch.core.JobParameters)
200201
*/
@@ -236,8 +237,10 @@ else if (jobParameter.getType() == ParameterType.DOUBLE) {
236237
}
237238

238239
/**
239-
* @param value a decimal value
240-
* @return a best guess at the desired format
240+
* Makes a best guess at converting a double to a string representation of a decimal
241+
* format.
242+
* @param value A decimal value.
243+
* @return a best guess at the desired format.
241244
*/
242245
private String decimalFormat(double value) {
243246
if (numberFormat != DEFAULT_NUMBER_FORMAT) {
@@ -250,15 +253,15 @@ private String decimalFormat(double value) {
250253

251254
/**
252255
* Public setter for injecting a date format.
253-
* @param dateFormat a {@link DateFormat}, defaults to "yyyy/MM/dd"
256+
* @param dateFormat A {@link DateFormat}, defaults to "yyyy/MM/dd".
254257
*/
255258
public void setDateFormat(DateFormat dateFormat) {
256259
this.dateFormat = dateFormat;
257260
}
258261

259262
/**
260263
* Public setter for the {@link NumberFormat}. Used to parse longs and doubles, so
261-
* must not contain decimal place (e.g. use "#" or "#,###").
264+
* must not contain decimal place (for example, use "#" or "#,###" but not "#.##").
262265
* @param numberFormat the {@link NumberFormat} to set
263266
*/
264267
public void setNumberFormat(NumberFormat numberFormat) {

spring-batch-core/src/main/java/org/springframework/batch/core/converter/JobParametersConverter.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2006-2018 the original author or authors.
2+
* Copyright 2006-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -24,8 +24,8 @@
2424

2525
/**
2626
* A factory for {@link JobParameters} instances. A job can be executed with many possible
27-
* runtime parameters, which identify the instance of the job. This converter allows job
28-
* parameters to be converted to and from Properties.
27+
* runtime parameters, which identify the instance of the job. This converter lets job
28+
* parameters be converted to and from properties.
2929
*
3030
* @author Dave Syer
3131
* @author Mahmoud Ben Hassine
@@ -35,18 +35,18 @@
3535
public interface JobParametersConverter {
3636

3737
/**
38-
* Get a new {@link JobParameters} instance. If given null, or an empty properties, an
39-
* empty JobParameters will be returned.
40-
* @param properties the runtime parameters in the form of String literals.
41-
* @return a {@link JobParameters} properties converted to the correct types.
38+
* Get a new {@link JobParameters} instance. If given null or an empty properties, an
39+
* empty JobParameters is returned.
40+
* @param properties The runtime parameters in the form of String literals.
41+
* @return a {@link JobParameters} object converted to the correct types.
4242
*/
4343
JobParameters getJobParameters(@Nullable Properties properties);
4444

4545
/**
4646
* The inverse operation: get a {@link Properties} instance. If given null or empty
47-
* JobParameters, an empty Properties should be returned.
48-
* @param params the {@link JobParameters} instance to be converted.
49-
* @return a representation of the parameters as properties
47+
* {@code JobParameters}, an empty {@code Properties} should be returned.
48+
* @param params The {@link JobParameters} instance to be converted.
49+
* @return a representation of the parameters as properties.
5050
*/
5151
Properties getProperties(@Nullable JobParameters params);
5252

0 commit comments

Comments
 (0)