diff --git a/release-notes/VERSION b/release-notes/VERSION index 5847232878..dd48c17da2 100644 --- a/release-notes/VERSION +++ b/release-notes/VERSION @@ -6,6 +6,8 @@ Version: 2.3.2 (xx-xxx-2014) #379: Fix a problem with (re)naming of Creator properties; needed to make Paranamer module work with NamingStrategy. (reported by Chris P, cpilsworth@github) +- Added `BeanSerializerBase._serializeObjectId()` needed by modules that + override standard BeanSerializer; specifically, XML module. ------------------------------------------------------------------------ === History: === diff --git a/src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java b/src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java index beeebd9561..d80483f2d3 100644 --- a/src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java +++ b/src/main/java/com/fasterxml/jackson/databind/ser/std/BeanSerializerBase.java @@ -7,9 +7,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.ObjectIdGenerator; import com.fasterxml.jackson.annotation.ObjectIdGenerators; - import com.fasterxml.jackson.core.*; - import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.introspect.Annotated; import com.fasterxml.jackson.databind.introspect.AnnotatedMember; @@ -581,6 +579,20 @@ protected final void _serializeWithObjectId(Object bean, w.serializer.serialize(id, jgen, provider); return; } + _serializeObjectId(bean, jgen, provider, typeSer, objectId); + } + + /** + * Overridable helper method added to make XML module work better with + * Object id handling. + * + * @since 2.3.2 + */ + protected void _serializeObjectId(Object bean, + JsonGenerator jgen,SerializerProvider provider, + TypeSerializer typeSer, WritableObjectId objectId) + throws IOException, JsonProcessingException, JsonGenerationException { + final ObjectIdWriter w = _objectIdWriter; String typeStr = (_typeId == null) ? null :_customTypeId(bean); if (typeStr == null) { typeSer.writeTypePrefixForObject(bean, jgen);