Skip to content

Commit d524cfb

Browse files
committed
Fixes #5110: adds missing ObjectMapper.createNonBlockingByteBufferParser() method
1 parent facee9c commit d524cfb

File tree

3 files changed

+20
-1
lines changed

3 files changed

+20
-1
lines changed

release-notes/CREDITS

+4
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,7 @@ Andy Boothe (@sigpwned)
4040
* Contributed #5025: Add support for automatic detection of subtypes (like `@JsonSubTypes`)
4141
from Java 17 sealed types
4242
[3.0.0]
43+
44+
Sébastien Deleuze (@sdeleuze)
45+
* Requested #5110: Add missing `ObjectMapper#createNonBlockingByteBufferParser()` method
46+
[3.0.0]

release-notes/VERSION

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Versions: 3.x (for earlier see VERSION-2.x)
1111
to use `Supplier`
1212
#5094: Change the way `BeanDescription` passed during deserializer construction
1313
to use `Supplier`
14+
#5110: Add missing `ObjectMapper#createNonBlockingByteBufferParser()` method
15+
(requested by Sébastien D)
1416

1517
3.0.0-rc3 (13-Apr-2025)
1618

src/main/java/tools/jackson/databind/ObjectMapper.java

+14-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,7 @@ public JsonParser createParser(DataInput content) throws JacksonException {
737737
* Factory method for constructing non-blocking {@link JsonParser} that is properly
738738
* wired to allow configuration access (and, if relevant for parser, callbacks):
739739
* essentially constructs a {@link ObjectReadContext} and then calls
740-
* {@link TokenStreamFactory#createParser(ObjectReadContext,DataInput)}.
740+
* {@link TokenStreamFactory#createNonBlockingByteArrayParser(ObjectReadContext)}.
741741
*
742742
* @since 3.0
743743
*/
@@ -746,6 +746,19 @@ public JsonParser createNonBlockingByteArrayParser() throws JacksonException {
746746
return ctxt.assignAndReturnParser(_streamFactory.createNonBlockingByteArrayParser(ctxt));
747747
}
748748

749+
/**
750+
* Factory method for constructing non-blocking {@link JsonParser} that is properly
751+
* wired to allow configuration access (and, if relevant for parser, callbacks):
752+
* essentially constructs a {@link ObjectReadContext} and then calls
753+
* {@link TokenStreamFactory#createNonBlockingByteBufferParser(ObjectReadContext)}.
754+
*
755+
* @since 3.0
756+
*/
757+
public JsonParser createNonBlockingByteBufferParser() throws JacksonException {
758+
DeserializationContextExt ctxt = _deserializationContext();
759+
return ctxt.assignAndReturnParser(_streamFactory.createNonBlockingByteBufferParser(ctxt));
760+
}
761+
749762
/*
750763
/**********************************************************************
751764
/* Public API: constructing Generator that are properly linked

0 commit comments

Comments
 (0)