@@ -187,9 +187,9 @@ protected Object readResolve() {
187
187
*/
188
188
189
189
/**
190
- * Factory used for constructing per-call {@link SerializerProvider }s.
190
+ * Factory used for constructing per-call {@link SerializationContext }s.
191
191
*<p>
192
- * Note: while serializers are only exposed {@link SerializerProvider },
192
+ * Note: while serializers are only exposed {@link SerializationContext },
193
193
* mappers and readers need to access additional API defined by
194
194
* {@link SerializationContextExt}
195
195
*/
@@ -754,7 +754,7 @@ public JsonParser createNonBlockingByteArrayParser() throws JacksonException {
754
754
*/
755
755
public JsonGenerator createGenerator (OutputStream out ) throws JacksonException {
756
756
_assertNotNull ("out" , out );
757
- return _streamFactory .createGenerator (_serializerProvider (), out );
757
+ return _streamFactory .createGenerator (_serializationContext (), out );
758
758
}
759
759
760
760
/**
@@ -767,7 +767,7 @@ public JsonGenerator createGenerator(OutputStream out) throws JacksonException {
767
767
*/
768
768
public JsonGenerator createGenerator (OutputStream out , JsonEncoding enc ) throws JacksonException {
769
769
_assertNotNull ("out" , out );
770
- return _streamFactory .createGenerator (_serializerProvider (), out , enc );
770
+ return _streamFactory .createGenerator (_serializationContext (), out , enc );
771
771
}
772
772
773
773
/**
@@ -780,7 +780,7 @@ public JsonGenerator createGenerator(OutputStream out, JsonEncoding enc) throws
780
780
*/
781
781
public JsonGenerator createGenerator (Writer w ) throws JacksonException {
782
782
_assertNotNull ("w" , w );
783
- return _streamFactory .createGenerator (_serializerProvider (), w );
783
+ return _streamFactory .createGenerator (_serializationContext (), w );
784
784
}
785
785
786
786
/**
@@ -793,7 +793,7 @@ public JsonGenerator createGenerator(Writer w) throws JacksonException {
793
793
*/
794
794
public JsonGenerator createGenerator (File f , JsonEncoding enc ) throws JacksonException {
795
795
_assertNotNull ("f" , f );
796
- return _streamFactory .createGenerator (_serializerProvider (), f , enc );
796
+ return _streamFactory .createGenerator (_serializationContext (), f , enc );
797
797
}
798
798
799
799
/**
@@ -806,7 +806,7 @@ public JsonGenerator createGenerator(File f, JsonEncoding enc) throws JacksonExc
806
806
*/
807
807
public JsonGenerator createGenerator (Path path , JsonEncoding enc ) throws JacksonException {
808
808
_assertNotNull ("path" , path );
809
- return _streamFactory .createGenerator (_serializerProvider (), path , enc );
809
+ return _streamFactory .createGenerator (_serializationContext (), path , enc );
810
810
}
811
811
812
812
/**
@@ -819,7 +819,7 @@ public JsonGenerator createGenerator(Path path, JsonEncoding enc) throws Jackson
819
819
*/
820
820
public JsonGenerator createGenerator (DataOutput out ) throws JacksonException {
821
821
_assertNotNull ("out" , out );
822
- return _streamFactory .createGenerator (_serializerProvider (), out );
822
+ return _streamFactory .createGenerator (_serializationContext (), out );
823
823
}
824
824
825
825
/*
@@ -934,7 +934,7 @@ public void writeTree(JsonGenerator g, TreeNode rootNode) throws JacksonExceptio
934
934
{
935
935
_assertNotNull ("g" , g );
936
936
SerializationConfig config = serializationConfig ();
937
- _serializerProvider (config ).serializeValue (g , rootNode );
937
+ _serializationContext (config ).serializeValue (g , rootNode );
938
938
if (config .isEnabled (SerializationFeature .FLUSH_AFTER_WRITE_VALUE )) {
939
939
g .flush ();
940
940
}
@@ -1235,7 +1235,7 @@ public void writeValue(JsonGenerator g, Object value) throws JacksonException
1235
1235
if (config .isEnabled (SerializationFeature .CLOSE_CLOSEABLE ) && (value instanceof Closeable )) {
1236
1236
_writeCloseableValue (g , value , config );
1237
1237
} else {
1238
- _serializerProvider (config ).serializeValue (g , value );
1238
+ _serializationContext (config ).serializeValue (g , value );
1239
1239
if (config .isEnabled (SerializationFeature .FLUSH_AFTER_WRITE_VALUE )) {
1240
1240
g .flush ();
1241
1241
}
@@ -1358,7 +1358,7 @@ public <T extends JsonNode> T valueToTree(Object fromValue)
1358
1358
{
1359
1359
// 02-Mar-2021, tatu: [databind#2411] Rewrite "valueToTree()" impl; old
1360
1360
// impl left for reference
1361
- return _serializerProvider ().valueToTree (fromValue );
1361
+ return _serializationContext ().valueToTree (fromValue );
1362
1362
}
1363
1363
1364
1364
/*
@@ -1764,7 +1764,7 @@ public <T> T readValue(DataInput src, TypeReference<T> valueTypeRef) throws Jack
1764
1764
public void writeValue (File file , Object value ) throws JacksonException
1765
1765
{
1766
1766
_assertNotNull ("file" , file );
1767
- SerializationContextExt prov = _serializerProvider ();
1767
+ SerializationContextExt prov = _serializationContext ();
1768
1768
_configAndWriteValue (prov ,
1769
1769
_streamFactory .createGenerator (prov , file , JsonEncoding .UTF8 ), value );
1770
1770
}
@@ -1778,7 +1778,7 @@ public void writeValue(File file, Object value) throws JacksonException
1778
1778
public void writeValue (Path path , Object value ) throws JacksonException
1779
1779
{
1780
1780
_assertNotNull ("path" , path );
1781
- SerializationContextExt prov = _serializerProvider ();
1781
+ SerializationContextExt prov = _serializationContext ();
1782
1782
_configAndWriteValue (prov ,
1783
1783
_streamFactory .createGenerator (prov , path , JsonEncoding .UTF8 ), value );
1784
1784
}
@@ -1797,15 +1797,15 @@ public void writeValue(Path path, Object value) throws JacksonException
1797
1797
public void writeValue (OutputStream out , Object value ) throws JacksonException
1798
1798
{
1799
1799
_assertNotNull ("out" , out );
1800
- SerializationContextExt prov = _serializerProvider ();
1800
+ SerializationContextExt prov = _serializationContext ();
1801
1801
_configAndWriteValue (prov ,
1802
1802
_streamFactory .createGenerator (prov , out , JsonEncoding .UTF8 ), value );
1803
1803
}
1804
1804
1805
1805
public void writeValue (DataOutput out , Object value ) throws JacksonException
1806
1806
{
1807
1807
_assertNotNull ("out" , out );
1808
- SerializationContextExt prov = _serializerProvider ();
1808
+ SerializationContextExt prov = _serializationContext ();
1809
1809
_configAndWriteValue (prov ,
1810
1810
_streamFactory .createGenerator (prov , out ), value );
1811
1811
}
@@ -1823,7 +1823,7 @@ public void writeValue(DataOutput out, Object value) throws JacksonException
1823
1823
public void writeValue (Writer w , Object value ) throws JacksonException
1824
1824
{
1825
1825
_assertNotNull ("w" , w );
1826
- SerializationContextExt prov = _serializerProvider ();
1826
+ SerializationContextExt prov = _serializationContext ();
1827
1827
_configAndWriteValue (prov , _streamFactory .createGenerator (prov , w ), value );
1828
1828
}
1829
1829
@@ -1839,7 +1839,7 @@ public String writeValueAsString(Object value) throws JacksonException
1839
1839
final BufferRecycler br = _streamFactory ._getBufferRecycler ();
1840
1840
// alas, we have to pull the recycler directly here...
1841
1841
try (SegmentedStringWriter sw = new SegmentedStringWriter (br )) {
1842
- SerializationContextExt prov = _serializerProvider ();
1842
+ SerializationContextExt prov = _serializationContext ();
1843
1843
_configAndWriteValue (prov , _streamFactory .createGenerator (prov , sw ), value );
1844
1844
return sw .getAndClear ();
1845
1845
} finally {
@@ -1859,7 +1859,7 @@ public byte[] writeValueAsBytes(Object value) throws JacksonException
1859
1859
{
1860
1860
final BufferRecycler br = _streamFactory ._getBufferRecycler ();
1861
1861
try (ByteArrayBuilder bb = new ByteArrayBuilder (br )) {
1862
- final SerializationContextExt ctxt = _serializerProvider ();
1862
+ final SerializationContextExt ctxt = _serializationContext ();
1863
1863
_configAndWriteValue (ctxt ,
1864
1864
_streamFactory .createGenerator (ctxt , bb , JsonEncoding .UTF8 ), value );
1865
1865
return bb .getClearAndRelease ();
@@ -1919,7 +1919,7 @@ protected final void _writeCloseableValue(JsonGenerator g, Object value, Seriali
1919
1919
{
1920
1920
Closeable toClose = (Closeable ) value ;
1921
1921
try {
1922
- _serializerProvider (cfg ).serializeValue (g , value );
1922
+ _serializationContext (cfg ).serializeValue (g , value );
1923
1923
if (cfg .isEnabled (SerializationFeature .FLUSH_AFTER_WRITE_VALUE )) {
1924
1924
g .flush ();
1925
1925
}
@@ -2361,7 +2361,7 @@ protected Object _convert(Object fromValue, JavaType toValueType)
2361
2361
// first: disable wrapping when writing
2362
2362
final SerializationConfig config = serializationConfig ()
2363
2363
.without (SerializationFeature .WRAP_ROOT_VALUE );
2364
- final SerializationContextExt ctxt = _serializerProvider (config );
2364
+ final SerializationContextExt ctxt = _serializationContext (config );
2365
2365
TokenBuffer buf = ctxt .bufferForValueConversion ();
2366
2366
// Would like to let buffer decide, but it won't have deser config to check so...
2367
2367
if (isEnabled (DeserializationFeature .USE_BIG_DECIMAL_FOR_FLOATS )) {
@@ -2431,7 +2431,7 @@ public <T> T updateValue(T valueToUpdate, Object overrides)
2431
2431
}
2432
2432
SerializationConfig config = serializationConfig ()
2433
2433
.without (SerializationFeature .WRAP_ROOT_VALUE );
2434
- SerializationContextExt ctxt = _serializerProvider (config );
2434
+ SerializationContextExt ctxt = _serializationContext (config );
2435
2435
TokenBuffer buf = ctxt .bufferForValueConversion ();
2436
2436
// Would like to let buffer decide, but it won't have deser config to check so...
2437
2437
if (isEnabled (DeserializationFeature .USE_BIG_DECIMAL_FOR_FLOATS )) {
@@ -2487,7 +2487,7 @@ public void acceptJsonFormatVisitor(JavaType type, JsonFormatVisitorWrapper visi
2487
2487
{
2488
2488
_assertNotNull ("type" , type );
2489
2489
_assertNotNull ("visitor" , visitor );
2490
- _serializerProvider ().acceptJsonFormatVisitor (type , visitor );
2490
+ _serializationContext ().acceptJsonFormatVisitor (type , visitor );
2491
2491
}
2492
2492
2493
2493
/*
@@ -2498,16 +2498,16 @@ public void acceptJsonFormatVisitor(JavaType type, JsonFormatVisitorWrapper visi
2498
2498
2499
2499
/**
2500
2500
* Overridable helper method used for constructing
2501
- * {@link SerializerProvider } to use for serialization.
2501
+ * {@link SerializationContext } to use for serialization.
2502
2502
*/
2503
- protected SerializationContextExt _serializerProvider (SerializationConfig config ) {
2503
+ protected SerializationContextExt _serializationContext (SerializationConfig config ) {
2504
2504
// 03-Oct-2017, tatu: Should be ok to pass "empty" generator settings...
2505
2505
return _serializationContexts .createContext (config ,
2506
2506
GeneratorSettings .empty ());
2507
2507
}
2508
2508
2509
2509
// NOTE: only public to allow for testing
2510
- public SerializationContextExt _serializerProvider () {
2510
+ public SerializationContextExt _serializationContext () {
2511
2511
// 03-Oct-2017, tatu: Should be ok to pass "empty" generator settings...
2512
2512
return _serializationContexts .createContext (serializationConfig (),
2513
2513
GeneratorSettings .empty ());
0 commit comments