这是indexloc提供的服务,不要输入任何密码
Skip to content

Add ObjectMapper.createParser() and createGenerator() methods #2647

@cowtowncoder

Description

@cowtowncoder

Jackson 3.x will have direct JsonParser and JsonGenerator construction methods in ObjectMapper (and ObjectReader, ObjectWriter), as they are needed due to closer interaction between mapper and parser/generator.
But even in 2.x pattern of

JsonParser p = mapper.getFactory().createParser(....)

is quite common (ditto for generator). So it would probably make sense to add these methods both for convenience, and to offer upgrade path for code for eventual 2.x -> 3.0 migration, where direct access to JsonFactory, then calling on creation methods will not work as well (since it will not link read/write contexts properly).

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