Skip to content
This repository was archived by the owner on Jan 22, 2019. It is now read-only.

Commit c7d4f83

Browse files
committed
Fix #137
1 parent ad36414 commit c7d4f83

File tree

4 files changed

+306
-125
lines changed

4 files changed

+306
-125
lines changed

README.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,15 @@ CsvMapper mapper = new CsvMapper();
8383
Pojo value = ...;
8484
CsvSchema schema = mapper.schemaFor(Pojo.class); // schema from 'Pojo' definition
8585
String csv = mapper.writer(schema).writeValueAsString(value);
86-
Pojo result = mapper.readerFor(Pojo.class).with(schema).read(csv);
86+
MappingIterator<Pojo> it = mapper.readerFor(Pojo.class).with(schema)
87+
.readValues(csv);
88+
// Either read them all one by one (streaming)
89+
while (it.hasNextValue()) {
90+
Pojo value = it.nextValue();
91+
// ... do something with the value
92+
}
93+
// or, alternatively all in one go
94+
List<Pojo> all = it.readAll();
8795
```
8896

8997
## Data-binding without schema
@@ -235,7 +243,8 @@ Jackson supports following extension or variations:
235243
# Limitations
236244

237245
* Due to tabular nature of `CSV` format, deeply nested data structures are not well supported.
238-
* Use of Tree Model (`JsonNode`) is supported, but only within limitations of `CSv` format.
246+
* You can use `@JsonUnwrapped` to get around this
247+
* Use of Tree Model (`JsonNode`) is supported, but only within limitations of `CSV` format.
239248

240249
# Future improvements
241250

release-notes/VERSION

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Project: jackson-dataformat-csv
1111
(contributed by georgewfraser@github)
1212
#130: Add fluent addColumns operation to CsvSchema.Builder
1313
(contributed by Peter A)
14+
#137: Inject "missing" trailing columns as `null`s
15+
(`JsonParser.Feature.INSERT_NULLS_FOR_MISSING_COLUMNS`)
1416
#139: Add `CsvParser.Feature.ALLOW_TRAILING_COMMA` to allow enforcing strict handling
1517
(contributed by Nick B)
1618
#142: Add methods for appending columns of a `CsvSchema` into another

0 commit comments

Comments
 (0)