I\'m using Jackson in order to read json messages. One of the values that I\' trying to parse is a List and another value contains the type of the data in the list. This is
You need to annotate your class with @JsonDeserialize(using = MessageDeserializer.class) and implement custom deserializer:
public class MessageDeserializer extends JsonDeserializer {
@Override
public Message deserialize(JsonParser jsonParser, DeserializationContext deserializationContext)
throws IOException, JsonProcessingException {
// YOU DESERIALIZER CODE HERE
}
}
@see examples here: How Do I Write a Jackson JSON Serializer & Deserializer?