@@ -489,7 +489,7 @@ return a `String` or an array of `String` objects. This really only gets you hal
489
489
there. A `FieldSet` is Spring Batch's abstraction for enabling the binding of fields from
490
490
a file resource. It allows developers to work with file input in much the same way as
491
491
they would work with database input. A `FieldSet` is conceptually similar to a JDBC
492
- `ResultSet`. `` FieldSet``s only require one argument: a `String` array of tokens.
492
+ `ResultSet`. A ` FieldSet` requires only one argument: a `String` array of tokens.
493
493
Optionally, you can also configure the names of the fields so that the fields may be
494
494
accessed either by index or name as patterned after `ResultSet`, as shown in the following
495
495
example:
@@ -610,8 +610,8 @@ delimiter. The most common delimiter is a comma, but pipes or semicolons are oft
610
610
as well.
611
611
* `FixedLengthTokenizer`: Used for files where fields in a record are each a "fixed
612
612
width". The width of each field must be defined for each record type.
613
- * `PatternMatchingCompositeLineTokenizer`: Determines which among a list of
614
- ``LineTokenizer``s should be used on a particular line by checking against a pattern.
613
+ * `PatternMatchingCompositeLineTokenizer`: Determines which `LineTokenizer` among a list of
614
+ tokenizers should be used on a particular line by checking against a pattern.
615
615
616
616
[[fieldSetMapper]]
617
617
===== FieldSetMapper
@@ -941,8 +941,8 @@ though a "LINEA" has more information than a "LINEB".
941
941
The `ItemReader` reads each line individually, but we must specify different
942
942
`LineTokenizer` and `FieldSetMapper` objects so that the `ItemWriter` receives the
943
943
correct items. The `PatternMatchingCompositeLineMapper` makes this easy by allowing maps
944
- of patterns to `` LineTokenizer``s and patterns to `` FieldSetMapper``s to be configured, as
945
- shown in the following example:
944
+ of patterns to `LineTokenizer` instances and patterns to `FieldSetMapper` instances to be
945
+ configured, as shown in the following example:
946
946
947
947
.XML Configuration
948
948
[source, xml, role="xmlContent"]
@@ -990,10 +990,10 @@ public PatternMatchingCompositeLineMapper orderFileLineMapper() {
990
990
}
991
991
----
992
992
993
- In this example, "LINEA" and "LINEB" have separate `` LineTokenizer``s , but they both use
993
+ In this example, "LINEA" and "LINEB" have separate `LineTokenizer` instances , but they both use
994
994
the same `FieldSetMapper`.
995
995
996
- The `PatternMatchingCompositeLineMapper` makes use of the `` PatternMatcher``'s match method
996
+ The `PatternMatchingCompositeLineMapper` uses the `PatternMatcher# match` method
997
997
in order to select the correct delegate for each line. The `PatternMatcher` allows for
998
998
two wildcard characters with special meaning: the question mark ("?") matches exactly one
999
999
character, while the asterisk ("\*") matches zero or more characters. Note that, in the
@@ -1023,8 +1023,7 @@ alone.
1023
1023
1024
1024
It is also common for a flat file to contain records that each span multiple lines. To
1025
1025
handle this situation, a more complex strategy is required. A demonstration of this
1026
- common pattern can be found in the
1027
- link:$$https://github.com/spring-projects/spring-batch/tree/master/spring-batch-samples#multiline$$[multiLineRecords] sample.
1026
+ common pattern can be found in the `multiLineRecords` sample.
1028
1027
1029
1028
[[exceptionHandlingInFlatFiles]]
1030
1029
===== Exception Handling in Flat Files
@@ -1451,7 +1450,7 @@ the parsing process by allowing the user to provide only callbacks).
1451
1450
1452
1451
We need to consider how XML input and output works in Spring Batch. First, there are a
1453
1452
few concepts that vary from file reading and writing but are common across Spring Batch
1454
- XML processing. With XML processing, instead of lines of records (`` FieldSet``s ) that need
1453
+ XML processing. With XML processing, instead of lines of records (`FieldSet` instances ) that need
1455
1454
to be tokenized, it is assumed an XML resource is a collection of 'fragments'
1456
1455
corresponding to individual records, as shown in the following image:
1457
1456
@@ -1791,7 +1790,7 @@ as with any `ItemReader`, adding extra input (in this case a file) could cause p
1791
1790
issues when restarting. It is recommended that batch jobs work with their own individual
1792
1791
directories until completed successfully.
1793
1792
1794
- NOTE: Input resources are ordered using `MultiResourceItemReader#setComparator(Comparator)`
1793
+ NOTE: Input resources are ordered by using `MultiResourceItemReader#setComparator(Comparator)`
1795
1794
to make sure resource ordering is preserved between job runs in restart scenario.
1796
1795
1797
1796
[[database]]
@@ -2387,9 +2386,9 @@ number of entities read from the database for each query execution.
2387
2386
[[databaseItemWriters]]
2388
2387
==== Database ItemWriters
2389
2388
2390
- While both flat files and XML have specific `` ItemWriter``s , there is no exact equivalent
2389
+ While both flat files and XML files have a specific `ItemWriter` instance , there is no exact equivalent
2391
2390
in the database world. This is because transactions provide all the needed functionality.
2392
- `` ItemWriter``s are necessary for files because they must act as if they're transactional,
2391
+ `ItemWriter` implementations are necessary for files because they must act as if they're transactional,
2393
2392
keeping track of written items and flushing or clearing at the appropriate times.
2394
2393
Databases have no need for this functionality, since the write is already contained in a
2395
2394
transaction. Users can create their own DAOs that implement the `ItemWriter` interface or
0 commit comments