I would like to serialize a HashMap as a string through the Jackson JSON processor. For example:
String strMap = getMapper().writeValueAsString(myHashMap);
r
For what it's worth, Jackson 1.6 will have this:
objectMapper.configure(SerializationConfig.WRITE_NULL_MAP_VALUES, false);
which does do what you want. Existing method only works for beans, and is not being changed to ensure maximum backwards compatibility.
EDIT: as per note on comments, this is for Jackson 1.x; Jackson 2.x has matching SerializationFeature