Skip to content

Add missing ObjectMapper#createNonBlockingByteBufferParser() method #5110

@sdeleuze

Description

@sdeleuze

Is your feature request related to a problem? Please describe.

In Jackson 3, for some reasons, only createNonBlockingByteArrayParser exists in ObjectMapper. Spring also uses createNonBlockingByteBufferParser in its JacksonTokenizer and currently has to write code like:

DeserializationContextExt context = objectMapper._deserializationContext();
JsonParser parser = context.assignAndReturnParser(objectMapper.tokenStreamFactory().createNonBlockingByteBufferParser(context));

Describe the solution you'd like

It would be better to have ObjectMapper#createNonBlockingByteBufferParser to avoid invoking objectMapper._deserializationContext() in production code and have a shorter syntax.

Usage example

JsonParser parser = objectMapper.createNonBlockingByteBufferParser();

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.0Issue planned for initial 3.0 release

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions