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

Commit

Permalink
Fix #137
Browse files Browse the repository at this point in the history
  • Loading branch information
cowtowncoder committed Mar 16, 2017
1 parent ad36414 commit c7d4f83
Show file tree
Hide file tree
Showing 4 changed files with 306 additions and 125 deletions.
13 changes: 11 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,15 @@ CsvMapper mapper = new CsvMapper();
Pojo value = ...;
CsvSchema schema = mapper.schemaFor(Pojo.class); // schema from 'Pojo' definition
String csv = mapper.writer(schema).writeValueAsString(value);
Pojo result = mapper.readerFor(Pojo.class).with(schema).read(csv);
MappingIterator<Pojo> it = mapper.readerFor(Pojo.class).with(schema)
.readValues(csv);
// Either read them all one by one (streaming)
while (it.hasNextValue()) {
Pojo value = it.nextValue();
// ... do something with the value
}
// or, alternatively all in one go
List<Pojo> all = it.readAll();
```

## Data-binding without schema
Expand Down Expand Up @@ -235,7 +243,8 @@ Jackson supports following extension or variations:
# Limitations

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

# Future improvements

Expand Down
2 changes: 2 additions & 0 deletions release-notes/VERSION
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Project: jackson-dataformat-csv
(contributed by georgewfraser@github)
#130: Add fluent addColumns operation to CsvSchema.Builder
(contributed by Peter A)
#137: Inject "missing" trailing columns as `null`s
(`JsonParser.Feature.INSERT_NULLS_FOR_MISSING_COLUMNS`)
#139: Add `CsvParser.Feature.ALLOW_TRAILING_COMMA` to allow enforcing strict handling
(contributed by Nick B)
#142: Add methods for appending columns of a `CsvSchema` into another
Expand Down
Loading

0 comments on commit c7d4f83

Please sign in to comment.