Skip to content

Commit dd9c4f9

Browse files
committed
Merge branch '2.19'
2 parents 4b75cc8 + 1c950b6 commit dd9c4f9

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,8 @@ public abstract WritableObjectId findObjectId(Object forPojo,
562562
* sequence. This method is mostly used for root-level serializer
563563
* handling to allow for simpler caching. A call can always be replaced
564564
* by equivalent calls to access serializer and type serializer separately.
565+
* Note: contextualization (call to {@link ValueSerializer#createContextual}) is done
566+
* before returning the {@link ValueSerializer}.
565567
*
566568
* @param rawType Type for purpose of locating a serializer; usually dynamic
567569
* runtime type, but can also be static declared type, depending on configuration
@@ -595,6 +597,8 @@ public ValueSerializer<Object> findTypedValueSerializer(Class<?> rawType,
595597
* sequence. This method is mostly used for root-level serializer
596598
* handling to allow for simpler caching. A call can always be replaced
597599
* by equivalent calls to access serializer and type serializer separately.
600+
* Note: contextualization (call to {@link ValueSerializer#createContextual}) is done
601+
* before returning the {@link ValueSerializer}.
598602
*
599603
* @param valueType Declared type of value being serialized (which may not
600604
* be actual runtime type); used for finding both value serializer and
@@ -626,6 +630,8 @@ public ValueSerializer<Object> findTypedValueSerializer(JavaType valueType, bool
626630
* property. This is most often used for root-level values (when writing
627631
* sequences), but may sometimes be used for more esoteric value handling for
628632
* delegation.
633+
* Note: contextualization (call to {@link ValueSerializer#createContextual}) is done
634+
* before returning the {@link ValueSerializer}.
629635
*
630636
* @since 3.0
631637
*/
@@ -648,6 +654,8 @@ public ValueSerializer<Object> findRootValueSerializer(Class<?> rawType)
648654
* property. This is most often used for root-level values (when writing
649655
* sequences), but may sometimes be used for more esoteric value handling for
650656
* delegation.
657+
* Note: contextualization (call to {@link ValueSerializer#createContextual}) is done
658+
* before returning the {@link ValueSerializer}.
651659
*
652660
* @since 3.0
653661
*/
@@ -671,6 +679,8 @@ public ValueSerializer<Object> findRootValueSerializer(JavaType valueType)
671679
* handling value of the property). Difference (if any) has to do with contextual resolution,
672680
* and method(s) called: this method should only be called when caller is
673681
* certain that this is the primary property value serializer.
682+
* Contextualization (call to {@link ValueSerializer#createContextual(SerializationContext, BeanProperty)}
683+
* will be done before returning the {@link ValueSerializer}.
674684
*
675685
* @param property Property that is being handled; will never be null, and its
676686
* type has to match <code>valueType</code> parameter.
@@ -685,6 +695,9 @@ public ValueSerializer<Object> findPrimaryPropertySerializer(JavaType valueType,
685695
return handlePrimaryContextualization(ser, property);
686696
}
687697

698+
/**
699+
* @see #findPrimaryPropertySerializer(JavaType, BeanProperty)
700+
*/
688701
public ValueSerializer<Object> findPrimaryPropertySerializer(Class<?> rawType,
689702
BeanProperty property)
690703
{
@@ -745,9 +758,7 @@ public ValueSerializer<Object> findContentValueSerializer(Class<?> rawType,
745758
*/
746759

747760
/**
748-
* Method variant used when we do NOT want contextualization to happen; it will need
749-
* to be handled at a later point, but caller wants to be able to do that
750-
* as needed; sometimes to avoid infinite loops
761+
* @see #findValueSerializer(JavaType)
751762
*/
752763
public ValueSerializer<Object> findValueSerializer(Class<?> rawType)
753764
{
@@ -764,8 +775,9 @@ public ValueSerializer<Object> findValueSerializer(Class<?> rawType)
764775

765776
/**
766777
* Method variant used when we do NOT want contextualization to happen; it will need
767-
* to be handled at a later point, but caller wants to be able to do that
768-
* as needed; sometimes to avoid infinite loops
778+
* to be done at a later point (many serializers are not in operational state before
779+
* contextualization, call to {@link ValueSerializer#createContextual(SerializationContext, BeanProperty)}),
780+
* but caller wants to be able to do that at a later point; sometimes to avoid infinite loops
769781
*/
770782
public ValueSerializer<Object> findValueSerializer(JavaType valueType)
771783
{

0 commit comments

Comments
 (0)