Skip to content

Commit 58c2a95

Browse files
Fixed Javadoc
1 parent da85749 commit 58c2a95

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ Properties can be overridden when starting a job via REST. You can then access t
231231

232232
### @Value
233233

234-
Annotate your Spring bean method with `@StepScope` and use the `@Value("#{jobParameters['name']}")` annotation on a method parameter
234+
Annotate your Spring bean method with `@StepScope` and use the `@Value` annotation on a method parameter
235235
to specify the desired job parameter name.
236236

237237
Please note that this approach won't transparently fall back to Spring environment properties. Thus,
@@ -240,7 +240,7 @@ if this is desired, you should manually check if a job parameter is `null` and i
240240
Example:
241241
```java
242242
@Bean @StepScope
243-
ItemWriter<Object> writer(@Value("#{jobParameters['propName']}") String prop) {
243+
ItemWriter<Object> writer(@Value("#{jobParameters['sampleProperty']}") String sampleProperty) {
244244
// ...
245245
}
246246
```
@@ -255,9 +255,10 @@ Example:
255255
```java
256256
Job job = jobBuilder.createJob("sampleJob", propertyResolver -> {
257257
String propertyValue = propertyResolver.getProperty("sampleProperty");
258-
...
258+
// ...
259259
});
260260
```
261+
261262
### JobProperties
262263

263264
In case you don't execute the same job concurrently, you may also look up properties from the `JobProperties` singleton.
@@ -275,7 +276,7 @@ ItemWriter<Object> writer() {
275276
return new ItemWriter<Object>() {
276277
@Override
277278
public void write(List<?> items) throws Exception {
278-
String prop = JobPropertyResolvers.JobProperties.of("sampleJob").getProperty("sampleProperty");
279+
String sampleProperty = JobPropertyResolvers.JobProperties.of("sampleJob").getProperty("sampleProperty");
279280
// ...
280281
}
281282
}

util/src/main/java/com/github/chrisgleissner/springbatchrest/util/core/property/JobPropertyResolvers.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,20 @@ public class JobPropertyResolvers implements Consumer<JobExecution> {
2222

2323
/**
2424
* @deprecated Accessing {@link org.springframework.batch.core.Job} properties via this singleton is not safe for
25-
* asynchronously executing the same code>Job</code> multiple times with different properties. In this case a {@link JobExecution}
25+
* asynchronously executing the same <code>Job</code> multiple times with different properties. In this case a {@link JobExecution}
2626
* may incorrectly use the properties of another, concurrently running <code>JobExecution</code> of the same <code>Job</code>.
2727
*
2828
* <p>
2929
* Instead, it is recommended to access job properties via either {@link StepExecution#getJobParameters()} or by annotating your
3030
* Spring-wired job beans with <code>@Value("#{jobParameters['key']}")</code>. You can get a handle of a <code>StepExecution</code>
3131
* by implementing {@link org.springframework.batch.core.StepExecutionListener} or extending
3232
* {@link com.github.chrisgleissner.springbatchrest.util.core.tasklet.StepExecutionListenerTasklet}.
33+
* </p>
3334
*
3435
* <p>For convenience, when using
3536
* {@link com.github.chrisgleissner.springbatchrest.util.core.JobBuilder#createJob(String, Consumer)} to build a job,
3637
* the returned {@link PropertyResolver} will first resolve against job properties, then against Spring properties.
38+
* </p>
3739
*
3840
* @see com.github.chrisgleissner.springbatchrest.util.core.JobBuilder#createJob(String, Consumer)
3941
*/

0 commit comments

Comments
 (0)