DATACOUCH-38 - Can't Deserialize Enum.

Enums, even although they are a simple type, must not use writeSimpleObject
since there is no "handler" in writeSimpleObject for Enums. Instead, we just
drop back to using the built-in ObjectMapper for handling enums.

-=david=-
This commit is contained in:
David Harrigan
2013-10-13 10:35:18 +01:00
committed by Michael Nitschinger
parent fa397759e3
commit d1779a5d73
2 changed files with 77 additions and 30 deletions

View File

@@ -88,7 +88,7 @@ public class JacksonTranslationService implements TranslationService {
continue;
}
if (simpleTypeHolder.isSimpleType(value.getClass())) {
if (simpleTypeHolder.isSimpleType(value.getClass()) && !Enum.class.isAssignableFrom(value.getClass())) {
generator.writeObject(value);
} else {
ObjectMapper mapper = new ObjectMapper();