serializeContentsUsing(value, jgen, provider, _valueSerializer);
return;
}
JsonSerializer<Object> prevSerializer = null;
Class<?> prevClass = null;
EnumValues keyEnums = _keyEnums;
final boolean skipNulls = !provider.isEnabled(SerializationFeature.WRITE_NULL_MAP_VALUES);
final TypeSerializer vts = _valueTypeSerializer;
for (Map.Entry<? extends Enum<?>,?> entry : value.entrySet()) {
final Object valueElem = entry.getValue();
if (skipNulls && valueElem == null) { // [JACKSON-314] skip entries with null values?
continue;
}
// 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...
StdSerializer<?> ser = (StdSerializer<?>) provider.findValueSerializer(
key.getDeclaringClass(), _property);
keyEnums = ((EnumSerializer) ser).getEnumValues();
}
jgen.writeFieldName(keyEnums.serializedValueFor(key));
if (valueElem == null) {
provider.defaultSerializeNull(jgen);
continue;
}
Class<?> cc = valueElem.getClass();