serializeContentsUsing(value, jgen, provider, _valueSerializer);
return;
}
JsonSerializer<Object> prevSerializer = null;
Class<?> prevClass = null;
EnumValues keyEnums = _keyEnums;
for (Map.Entry<? extends Enum<?>,?> entry : value.entrySet()) {
// First, serialize key
Enum<?> key = entry.getKey();
if (keyEnums == null) {
/* 15-Oct-2009, tatu: This is clumsy, but still the simplest efficient
* way to do it currently, as Serializers get cached. (it does assume we'll always use
* default serializer tho -- so ideally code should be rewritten)
*/
// ... and lovely two-step casting process too...
SerializerBase<?> ser = (SerializerBase<?>) provider.findValueSerializer(
key.getDeclaringClass(), _property);
keyEnums = ((EnumSerializer) ser).getEnumValues();
}
jgen.writeFieldName(keyEnums.serializedValueFor(key));
// And then value
Object valueElem = entry.getValue();
if (valueElem == null) {
provider.defaultSerializeNull(jgen);
} else {