Skip to content

Add convenience methods for creating List, Map valued ObjectReaders (ObjectMapper.readerForListOf()) #2693

@cowtowncoder

Description

@cowtowncoder

One case where helper class TypeReference is often needed is for code like:

List<ValueType> values = mapper.readerFor(new TypeReference<ValueType>() { })
    .readValue(source);

and similarly for Maps. It should be easy to allow a short-cut like:

List<ValueType> values = mapper.readerForListOf(Value.class)
    .readValue(source);
Map<String, ValueType> valueMap = mapper.readerForMapOf(Value.class)
   .readValue(otherSource);

similar to what jackson-jr exposes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions