public < T > void addClassSerializer ( Class < ? extends T > classToMap , JsonSerializer < T > classSerializer ) { setNewObjectMapper ( ) ; // Is this right, setting a new object mapper on each add operation? SimpleModule mod = new SimpleModule ( "GeolatteCommonModule-" + classSerializer . getClass ( ) . getSimpleName ( ) ) ; mod . addSerializer ( classToMap , classSerializer ) ; mapper . registerModule ( mod ) ; }
Adds a serializer to this mapper . Allows a user to alter the serialization behavior for a certain type .